I got tests 1, 2, 3 correct. But the rests of the tests for arguments of any other value I can’t pass. Can someone please help?
function booWho(argument) {
if (argument === true || argument === false) {
console.log(true);
} else {console.log(false);}
return true || false;
}
console.log(booWho(true));
console.log(booWho(false));
console.log(booWho([1, 2, 3]));
console.log(booWho([].slice));
console.log(booWho({ “a”: 1 }));
console.log(booWho(1));
console.log(booWho(NaN));
console.log(booWho(“a”));
console.log(booWho(“true”));
console.log(booWho(“false”));
1 Like
dhess
2
Welcome to the forum @chibilou0x !
Hopefully, this MDN reference will help you:
Boolean - JavaScript | MDN
I still don’t get it. I don’t know how to link the MDN ‘Creating false values’ examples to this practice.
I am honestly not sure what else I need to add to my function block in order to prove that the other arguments are false.
dhess
4
This is probably a more helpful MDN link:
typeof - JavaScript | MDN
ILM
5
this is what your function is returning, which means it always return the same thing