Basic Algorithm Scripting: Boo who

Tell us what’s happening:

Your code so far


function booWho(bool) {
  // What is the new fad diet for ghost developers? The Boolean.
  return if (typeof(bool) === boolean) ? true : false;
}

booWho(null);

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/boo-who/

add quote marks to the word 'boolean'

My code still not working:

This is the last my code:

function booWho(bool) {
// What is the new fad diet for ghost developers? The Boolean.
return typeof(bool === ‘boolean’) ? true : false;
}

booWho(null);

My code is working with this solution:

function booWho(bool) {
if (typeof bool === ‘boolean’){
return true;
}
else{
return false;
}
}

booWho(null);

You need to close the brackets after bool.
return typeof(bool) == 'boolean' ? true : false;

There are easier ways to check though.
For instance, you could simply: return typeof(bool) === 'boolean'; since you are just returning the exact same value you are checking for.

Finally, be careful with using the appropriate quote mark. I don’t know if something formatted your quote marks, but the fancy ones do not work.

Fancy: ‘boolean’ (doesn’t work)
Ugly: 'boolean' or "boolean" (works)

function booWho(bool) {
// What is the new fad diet for ghost developers? The Boolean.
return typeof bool === ‘boolean’? true:false;
}

console.log(booWho([1, 2, 3]));