More on Control Flow in JS - Or. Error message


I am getting an error message and both strings printing to the console when I have one true and one false, however when I have either both true or both false I am getting the proper single response. What am I missing? I tried command+r to refresh my browser but that doesn't make a difference.

this is the error message:

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 == true) {
      return('get some rest!');
  } else {
      return('doing great!');


so I'm not sure how this will effect the code but my code didn't include == true. I'm pretty sure this is because when something is in the condition it is already checking if its true. also your return statements don't need parenthesis. otherwise your code should be fine


oh i almost forgot, the instructions are asking for you to return false, not a string. so instead of get some rest and doing great, you should have true and false without " " ' '


awesome!, thanks kalebmfratelo, that worked. I must have misunderstood the instructions. I appreciate the quickness of your help!


no problem. I like to watch for new posts so I can help as soon as possible. I hope you enjoy the rest of the course!


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