Trying to fix undefined variable [SOLVED]

Trying to fix undefined variable [SOLVED]
0

#1

This is not actually a fcc challenge, but another challenge that I’m stuck on. I’m hoping someone can offer some insight on how to make the string display inside this HTML:

<body><p></p></body>

Right now it displays as:

<body><p>undefined</p></body>

Here’s the script:

//I need both of these functions, but the sixthsense() function has "undefined" for output. Can you make them work together?
function sensible(bool){
    bool ? sense = "Common sense is quite common" : sense = "Common sense is not very common.";
};
sixthsense = function(){
    var cLog = sensible(false);
    document.body.querySelector('p').innerHTML = cLog;   
};
sixthsense();

#2

You’re not returning anything from “sensible”.

https://jsfiddle.net/dxfs9zjh/1/


#3

Thanks so much! I’m facepalming for not seeing that.