More on Control FLow JS Lesson 13 Not


#1

I don't understand what I'm doing wrong, and I especially would like some help on what to put in the if statement. Inviting tips and editing! :grin:

var programming = false

var happy = function() {
if (!programming || happy) {
return false;
}
else {
return true;
}
};

Thanks


#2

couple of problems, first in this line:

if (!programming || happy)

happy is not a variable, it is function name, remove || happy

Then, programming is false, so !programming is true, so the if gets executed, and should return true, not false


#3

Thank you so much! That makes alot of sense.


#4

Also, your true & false statements are reversed:

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