The Boolean
constructor creates boolean objects (not to be confused with boolean primitives). The boolean objects are not very useful and are listed here for the sake of completeness.
>>> var b = new Boolean(); >>> b.valueOf()
false
>>> b.toString()
"false"
A boolean object is not the same as a boolean primitive value. As you know, all objects are truthy:
>>> b === false
false
>>> typeof b
"object"
Boolean objects don't have any properties other than the ones inherited from Object
.