The Boolean object is a wrapper object that holds a primitive Boolean value.
The Boolean object provides a method for converting the value to a string.
A primitive boolean can have only one of two states: true or false.
A Boolean object is created with the Boolean() constructor and the new operator or by the Boolean() function.
var variable = new Boolean(value)
var variable = Boolean(value)
value is the value to be converted to a Boolean value and stored in the object.
The values null, NaN, "" (empty string), and 0 (zero) are converted to false.
All other values (including the string "false") are converted to true.
If the new operator is used, the new Boolean object is returned.
If the Boolean() function is used, the primitive Boolean value is returned.
Method toString() returns a string representation of the primitive Boolean value.
If the object contains true, the string "true" is returned.
If the object contains false, the string "false" is returned.