What is a ‘boolean’?

A boolean in coding is like a digital switch that can only be in one of two positions: on or off. It's like a light switch that can either be turned on (representing true) or turned off (representing false).

In computer programming, we use booleans to make decisions. For example, we might use a boolean to determine if it's raining outside. If it's raining, we say "true," and if it's not raining, we say "false." It helps the computer understand and act based on certain conditions being either true or false.


Previous
Previous

Understanding Arrays: A Simple Guide for Parents

Next
Next

What is an integer in coding?