Data type part 5
Booleans
In JavaScript Boolean, you can have one of two values, either true or false.
These are useful when you need a data type that can only have one of two values, such as Yes/No, On/Off, True/False.
Example:var isActive = true;
var isHoliday = false;
The Boolean value of 0 (zero), null, undefined, empty string is false.
Everything with a "real" value is true.
What two values does the Boolean data type accept?
Select all that apply
Comments
Post a Comment