What is wrong?


#1

var programming = false

var happy = function() {

if(!programming) {
happy = true;
} else {
happy = false;
}
};

Error = Oops, try again.
Your code caused the following error: TypeError: happy is not a function

What is wrong ?


#2

@1shadow0,
You could try using

var programming = false

var happy = function() {

    if(!programming) {
        return false;
    } else {
       return true;
    }
};
console.log( happy() );
console.log( "== End of my code, here-after possible code-checker results ==" );