JavaScript BooleanObjects
The Boolean object is used to convert non-Boolean values to Boolean values (true or false).
Online Examples
Check Boolean Values
Check whether the Boolean object is true or false.
Complete Boolean Object Reference Manual
We provideJavaScript Boolean Object Reference Manual, which includes all properties and methods that can be used with Boolean objects.
This manual contains detailed descriptions of each property and method along with related examples.
Create a Boolean Object
A Boolean object represents two values: "true" or "false"
The following code defines a Boolean object named myBoolean:
var myBoolean=new Boolean();
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")!
Other Extensions