Understanding Boolean Values
Another data type is the Boolean. Booleans may only be one of two values: true or false.
Note: Boolean values are never written with quotes. The strings "true" and "false" are not Boolean and have no special meaning in JavaScript.
- Example:
function welcomeToBooleans() {
return true;
}
welcomeToBooleans(); // will display true
function welcomeToBooleans() {
return false;
}
welcomeToBooleans(); // will display false
Top comments (0)