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.
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)