I'm not sure what i'm supposed to be doing


#1


https://www.codeacademy.com/courses/javascript-beginner-en-qDwp0/2/3?curriculum_id=506324b3a7dffd00020bf661

I'm being told that I have a bad assignment on lines 6 and 7 and would appreciate help with my syntax.

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

#2

Hi,

the instructions says "return true" or "return false"

  if(tired || bored){
      return true;
      } else {
          return false; 
          }
};

This tired || bored = true;} is no valid Syntax .


#3

|| have a higher priority than = so you'll evaluate tired||bored first and then you have

true = true

meaning you have a value on the left of an assignment operator. So the first question would be why do you use an assignment operator at all better use a comparison operator like == or ===.


#4

your if condition is correct:

if (tired || bored )

but then inside your if:

if (tired || bored ){
  return true;
}

and return false in your else.