12. Or


#1

// Declare your variables here!
var bored= false;
var tired= true;
var nap = function() {
// Add your if/else statement here!
if(tired= true || bored= true){
console.log("true")
}
else {
console.log("false")
}
};
//It tells me that I didn't declare a variable which is known as tired.. I mean.. What??//


#2

There is a syntax error in your code and that is why codecademy is not able to properly check your code.


if(tired= true || bored= true){

Is this how we compare values? To check if tired (or bored) is true you should use equality check operator (===).


According to instructions your code should return, not print out false or true,


#3

// Declare your variables here!
var bored= false;
var tired= true;
var nap = function() {
// Add your if/else statement here!
if(tired === true || bored === true){
console.log(true);
}
else {
console.log(false);
}
};

//It still doesn't work please help me!!//


#4

Let me quote myself:

According to instructions your code should return, not print out, false or true.


#5

hey this still doesnt pass
var tired = true;
var bored= false ;

var nap = function(tired,bored) {
// Add your if/else statement here!
if(tired===true || bored === true ){
return true;
}

          else{
              return false;
              }

};
nap();


#6

ohh sorry my bad, i messed up my function


#7

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