24

Booleans and the Stricter === and !== Operators

In this Chapter

  • Learn more about what goes on behind true and false

  • Understand what boolean objects and functions do

  • Find out the difference between simple inequality operators and strict inequality operators

While it’s polite to say that all types are interesting and fun to be around, you and I both know that is a lie. Some types are just boring. The boolean type is one such example. Here is the reason why: Whenever we initialize a variable using either true or false, we create a boolean:

let sunny = false;
let traffic = true;

Congratulations. If you just know this, you are 80 percent of the way there in fully understanding how booleans operate. Of course, 80 percent isn’t really adequate ...

Get Javascript Absolute Beginner's Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.