Build a Boolean Check Function - Build a Boolean Check Function

Tell us what’s happening:

all my arguments are correct but i keep getting error

Your code so far

const booWho = (arg) => {
  if (typeof arg === 'boolean') {
    return "true"
  }
  else {
    return "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("false"))

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.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

Here are some troubleshooting steps you can follow. Focus on one test at a time:

  1. Are there any errors or messages in the console?
  2. What is the requirement of the first failing test?
  3. Check the related User Story and ensure it’s followed precisely.
  4. What line of code implements this?
  5. What is the result of the code and does it match the requirement? (Write the value of a variable to the console at that point in the code if needed.)

If this does not help you solve the problem, please reply with answers to these questions.

You need to return true or false boolean values, not strings.

2 Likes