Lost, help on 12.or


#1
    // Declare your variables here!
var tired = false;
var bored = true;

var nap = function(tired, bored) {
  // Add your if/else statement here!
  if(tired || bored === true){
        return true;  
    }else if(tired && bored === false){
        return false;
    }else{
        return true;    
    }
};

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


#2

What's the point of the extra

else if(tired && bored === false){
    return false;
}

?
or (||) will result in true if:

  • Tired is true, bored is false
  • Tired is false, bored is true
  • Tired is true, bored is true

or is essentially and, but or will also work when only one of the two results in true.

(Oh, and you should edit the last else to return false)