Basic Algorithm Scripting - Boo who

Hey all,

I’m having trouble googling why this doesn’t work. It succeeds on every test except
" booWho(false) should return true. "

function booWho(bool) {
   return bool === ( true || false );
}
booWho(null);

Challenge: Basic Algorithm Scripting - Boo who

Link to the challenge:

This evaluates (true || false) first and then determines if it is === to bool.

What does (true || false) evaluate to? Will it be equal to bool if bool is false?

Ah I understand, thank you very much! I knew there was a reason it wasn’t in anyone else’s answers :stuck_out_tongue:

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