Error message on "or"


#1


I am stuck on the lesson 12 of the section "More Control Flow".


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

// Declare your variables here!
var tired = true;
var bored = false;
var nap = function() {
  // Add your if/else statement here!
  if(tired || bored) {
      console.log("good show");
   }
};


#2

I figured this out, no need for help, thanks any ways!


#3

I think there are two issues here:
1) you need to return something, in this case false if "tired and bored are both false" .
2) ...I'm not sure about this one but as the error message you posted says:

...when tired and bored are both false.

it means that you have to check whether the variables tired AND bored are both false. So, you have to connect to them via an logical AND and not an OR.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.