12.or


#1

var tired= true;
var bored= false;

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

};

m getting "function doesnt return false when tired and bored are false"
what i am missing?


#2

if tired and/or bored are true, the else clause run. normally the if condition would be true and run, but you use a ! causing a reverse (true becomes false)

if both are false, the if condition will be false, but thanks to your ! it becomes true. So either swap true and false, or remove the exclamation mark


#3

can u plz gv me da format of the prgrmmng


#4

nope, guidelines prevent me


#5

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