Any suggestions? Control Flow Lesson 12/14


#1


I'm receiving a 'true' result when the code is executed. This makes sense because the code is looking at and 'or' designation.

Confused as to why i'm receiving this error msg:

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


var tired = true;
var bored = false;


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

nap();


#2

You need both to be false because you're using the "or" operator; however, you have tired set to true, so it views it as true.


#3

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