...

The Most Important Data Type: Boolean

We are about to learn about a data type that may look completely useless on the surface, but is possibly the single most important data type you will need to master: the boolean data type.

A boolean is a data type with only two possible values: true, and false. While strings and numbers can represent a wide range of values, booleans can only represent questions that can only be answered with "yes" or "no":

  • Is the sky blue? true
  • Is 2 + 2 equal to 5? false
  • Is CodeSteps.dev the best coding tutor? true *

* This statement may or may not be completely objective

Is it Raining?

Run the code sample for a simple example of a boolean variable followed by a condition. To get this code sample to work as intended, change the boolean value to true.

Loading...

Output (Console)