Free Code Camp Algorithm Solution: Boo Who

jackLyons Free Code Camp
0
Free Code Camp Algorithm Solution: Boo Who

In this post I show you how to solve the Free Code Camp Boo Who AlgorithmIt is actually probably one of the easiest problems out there, but it can trip you up if you don’t do your research. A bit of Googling and reading up, and you’ll knock this one over in no time. Let’s begin!

To solve this challenge you are given the following hints, plus some extra reading from me:

But also, be sure to read the question carefully. It’s important to understand what the question is asking of you. It says: “Check if a value is classified as a boolean primitive. Return true or false.” Basically, all this means is you need to return true or false based on the given function argument.

Everything Without a “Real” Value is False

Ok, so now you’re all read up on Booleans. Let’s smash this problem in one line! Seriously, it’s that easy. Think again, what are we trying to achieve? Simply put, we just want to return true or false based on the Boolean type. Thus, all you really need to write is the following code:


function booWho(bool) {
 return typeof bool === 'boolean';
}
booWho(1);

And there you have. That’s all! If you found this article useful, please share it with your friends, or subscribe to my newsletter by clicking the SUBSCRIBE button below. I won’t spam you that often, and if I do, it is always going to be genuine information on all things web dev, to help you improve and stay up to date.


The Web Developers Bootcamp.

A n00b friendly guide to becoming a pro!

If you’re feeling a bit overwhelmed and a little lost with all these crazy hard Free Code Camp exercises then this course is for you!

While I am oh so grateful for the opportunity to learn through Free Code Camp, I still find that learning to code alone and without proper guidance extremely exhausting. Which is why I’ve started to substitute my education with an incredible online resource called the Web Developers Bootcamp courtesy of Udemy.

This course has helped me brush off the cobwebs, unlearn my self-taught bad habits and gain a solid understanding of the true fundamentals of web development. It has helped me see why it is important to understand these JavaScript problems and how they apply to the real world.

This bootcamp will teach you how built beautiful sites with Bootstrap, add in functionality with JavaScript and write back end code with Node.js all in a series of short, sharp, no BS video modules. I seriously could not recommend it any higher. Check it out and let me know what you think 🙂

The Web Developers Bootcamp
The Web Developer Bootcamp.
The only course you need to learn web development – HTML, CSS, JS, Node, and More!

Sign up to receive up-to-date web tips, tricks and code hacks!