Help 12 "or"


var tired = true
var bored = false

var nap = function() {
// Add your if/else sttement here!
if (tired || bored === false)
return true

else {
return false
it says Unexpected end of input


if (tired || bored === false)

Each comparison must have a conditional operator, like so:

if (tired === false || bored === false)


Guess the problem is the missing } for the function. @zoulit also avoid using semicolons after conditions e.g. here:

 else {
    return false

Also as @lolman already mentioned the interpreter is not context sensitive so if both should be compared to false than both need their own comparing operator otherwise tired would be one condition and bored === false would be the other one.


no it doesn't, as long as the variables are set to a condition(true/false) before hand like they are then you simply need to type
(tired || bored){
return true;
} <---- you also forgot this that's why it was an unexpected end of input