12. Or - More on Control Flow in JS


#1

The instructions are to create two variables, tired and bored, and set one equal to true and the other equal to false. And inside the nap function to create an if statement that returns true if either tired or bored, or both are true, and false otherwise.

My problem is that although my code does pass according to codecademy, I don't actually get anything returned.

Here is my code:

var tired = false;
var bored = true;

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

Thanks in advance :smiley:


#3

Nevermind, I forgot to run it by using nap ();