Could someone please explain to me why booWho(false) does not return true?
it is the only check that isn’t passing.
Ps: i know that i can use 'type of ’ but i still want to understand why booWho(false) does not returns true.
function booWho(bool) {
if(bool === true || false){
return true;
}
else{
return false;
}
}
console.log(booWho(null));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Challenge: Basic Algorithm Scripting - Boo who
Link to the challenge: