Lesson 12- Or / More on Control Flow in JS (I don't know what's wrong)


When I submit the code it says, "It looks like your function doesn't return true when tired is true and bored is false." I don't know what I'm doing wrong.
var tired = true;
var bored = false;

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

nap(tired, bored);



Instead of testing with the || or operator, try with the && and


The whole lesson is about using the or operator


HI I just read the instruction of the lesson your function dont need of the argument tired and bored just remove them.


Oh, that worked! Thanks!


Pls ckeck my code. What is wrong? It says me "Make sure to set bored to the opposite of tired (that is, if tired is true, bored should be false)".

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

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


You set both var tired and var bored to true. It says in the instructions that one should be set to true and one should be set to false.