August 1999
Intermediate to advanced
1488 pages
72h 53m
English
var variable = new Boolean(value) var variable = Boolean(value)
The Boolean object is a wrapper object that holds a primitive Boolean value, as well as provides a method for converting the value to a string. A primitive boolean can have only one of two states: true or false. Internally, JavaScript uses the number 1 to represent true and 0 to represent false but provides the toString() method to return the strings "true" and "false".
A Boolean object is created with the Boolean() constructor and the new operator or by the Boolean() function. The argument, return value, and method associated with this object are listed in Table 6.19.
Read now
Unlock full access