The Boolean Data Type in JavaScript

The Boolean data type in JavaScript can store one of two possible values: true or false. Boolean values are the result when you do comparisons in JavaScript. If you ask JavaScript something like: “Is 3 equal to 30?,“ it will respond with a Boolean value of false.

The Boolean data type is named after the mathematician George Boole, so it’s always capitalized.

Do a few experiments with Booleans. Open the JavaScript Console and try typing each of the following statements, pressing Return or Enter after each one to see the result. Note that a single‐line comment is used after each statement to explain what it means. You don’t need to type these comments into the console, but you can if you want.