In computer science, a Boolean is a logical data type that can have only the values true
or false
.
For example, in JavaScript, Boolean conditionals are often used to decide which sections of code to execute (such as in if statements) or repeat (such as in for loops).
Below is some JavaScript pseudocode (it's not truly executable code) demonstrating this concept.
/* JavaScript if statement */
if (boolean conditional) {
// code to execute if the conditional is true
}
if (boolean conditional) {
console.log("boolean conditional resolved to true");
} else {
console.log("boolean conditional resolved to false");
}
/* JavaScript for loop */
for (control variable; boolean conditional; counter) {
// code to execute repeatedly if the conditional is true
}
The Boolean value is named after English mathematician George Boole, who pioneered the field of mathematical logic.
Above is a general introduction. The term Boolean can have more specific meanings depending on the context. It may refer to:
true
or false
.
true
or false
in the enumerated list.
true
or false
values. If an HTML tag contains a boolean attribute â no matter the value of that attribute â the attribute is set to true
on that element. If an HTML tag does not contain the attribute, the attribute is set to false
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3