Booleans hold a true or false value and are mostly used in conditional statements to control a program’s flow of execution. This data type is named after George Boole, a 19th century English logician.
Some languages use comparison operators such as:
<=, for “greater than” and “less than”, respectively.
notto test for equality and inequality, respectively.
Other languages may use a combination of “falsy” values (e.g.
0) and “truthy” values such as
The following example uses a comparison operator to return
else code block will run: