GlossaryFundamentals

What is a Boolean?

A Boolean is a data type that can be true or false.

A Boolean is a basic data type used in programming that represents one of two values: true or false. It is named after mathematician George Boole, who worked on logic.

Booleans are often used in conditions to control the flow of a program. For example, they help determine whether a certain action should be taken based on whether a condition is met.

In programming, you might see a Boolean in use when checking if a user is logged in or not. If the user is logged in, the Boolean is true; if not, it is false.

Example

isLoggedIn = true;

Want to use Boolean in real work?

WeCode workshops are built around AI coding tools. Pick a tier, or browse more glossary entries to get the lay of the land.