Why is it Returning False When it Should Be True



Why is it returning false? Shouldn't it be true? Because !programming === true, so the true === true inside the if statement will result to true. So then it should return true... right? My code is returning false.

// Declare your variables here!
programming = false;

var happy = function() {
  // Add your if/else statement here!
  if(!programming === true) {
        return true;  
    } else {
        return false;    


your function does return true, the false you see in the console is the value of programming (the codecademy console logs it for some obscure reason)

However, you function never executes because you don't call it:


functions only execute when called. If you execute your function you should see true in the console


Cool. Maybe it would be better to include calling the function happy() as part of the instruction.

Thanks bro :smile: