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;
Related terms
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.
