OR Operator Return as False instead of True


#1

According to the lesson, the OR operator evaluates to true when one or the other or both expressions are true; if they're not, it evaluates to false. So I expect my code to return true, but it returns false. I guess it may be a bug, but since I'm not sure I decided to ask

P:S - My code runs well and it was ticked for me to go on to the next exercise.

 
tired = true;
bored = false;


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


#2

a function only execute when called, you never call your function, so it never executes


#3

True, that was an oversight on my part. Thanks


#4

Does it all make sense or are you still struggling with something?


#5

Yes, it makes sense. I have been able to do it. Thank you :slight_smile:


#6