12.) It looks like your function doesn't return true when tired is true and bored is false


#1

It looks like your function doesn't return true when tired is true and bored is false. Not sure how to fix this :frowning:


var tired = true;
var bored = false;

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


#2

You're yet to close the function with a curly bracket.

See suggested code below:

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

#3

Ah thank you! Never would have thought of that myself :joy:


#4

You're welcome.

We help one another in the community.

Code on! :slight_smile:


#5

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