JavaScript Boolean
Object
The Boolean object is used to convert non-boolean values to boolean values (true or false).
Online Examples
Complete Boolean Object Reference Manual
We provide the JavaScript Boolean Object Reference Manual, which includes all properties and methods available for the Boolean object.
This manual contains detailed descriptions and examples for each property and method.
Creating a Boolean Object
The Boolean object represents two values: "true" or "false".
The following code defines a Boolean object named myBoolean:
If the Boolean object has no initial value or its value is:
0
-0
null
""
false
undefined
NaN
Then the object's value is false. Otherwise, its value is true (even when the variable's value is the string "false")!