OR Operator Return as False instead of True


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;


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


True, that was an oversight on my part. Thanks


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


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