Build a Boolean Check Function - Build a Boolean Check Function

Tell us what’s happening:

It is returning all values correct still it doesn’t let me pass

p.s instead of that body function i try use :

function booWho(n) {
if (n===true || n==false) return “true”;
else return “false”
}

it still passes all but doesn’t let me go
can you help me pls?

Your code so far

function booWho(n) {
  if (n===true || n===false) { n = "true"; }
  else {n = "false";}
  return n;
}
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"));    

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36

Challenge Information:

Build a Boolean Check Function - Build a Boolean Check Function
https://www.freecodecamp.org/learn/full-stack-developer/lab-boolean-check/build-a-boolean-check-function

This returns the string "true" or "false", not the boolean values true or false that the test expects.

1 Like

Thank you very much Sir :sign_of_the_horns:
just took that “ “ off and pass