What is wrong with my code for 12. Or


#1

var tired = true;
var bored = false;

var nap = function() {
if(!tired || bored){
return true;
} else {
return false;
}
};


#2

What is wrong?

Do you get a syntax error?

Do you pass the lesson?

Explain your problems.


#3

Oops, try again. It looks like your function doesn't return false when tired and bored are both false.

(this is what the computer said)


#4

Ok i see your problem @jimmy.bush Look at the statement here:

It has an or statement, so one of them has to be true in order to go to the if statement. In this case tired is true, so it returns true... Which is not what codecademy suggested, so just change that || to a && Which symbolizes And Operator, so both of them must be true. And please format your code by taking a look here. Thankyou