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), nullundefined, empty string is false.
Everything with a "real" value is true.

What two values does the Boolean data type accept?
Select all that apply
true
false
right
wrong

Comments

Popular posts from this blog

Introducing object part 3

Comparison Operators part 2

Module 2