JavaScript Boolean (Boolean) Object
Boolean (Boolean) object is used to convert non-Boolean value to a Boolean value (true or false).
Online examples
Check Boolean value
Check the Boolean object is true or false.
Complete Boolean (Boolean) Object Reference
We provide JavaScript Boolean Object Reference Manual , including all properties and methods that can be used in a Boolean object.
The manual contains a detailed description and relevant examples for each of the properties and methods.
Creating Boolean objects
Boolean objects represent two values: "true" or "false"
The following code defines the Boolean object called myBoolean of:
var myBoolean=new Boolean();
If no initial value of the Boolean object or its value:
- 0
- -0
- null
- ' "
- false
- undefined
- NaN
Then the object is false. Otherwise, its value is true (even when the value of the string variable is "false")!