JavaScript Boolean Reference
This chapter contains a brief overview of the properties and method of the global Boolean object.
The JavaScript Boolean Object
The Boolean object is an object wrapper around the boolean value true
or false
. This Boolean object type exists primarily to provide a toString()
method to convert boolean values to strings.
To learn more about the Boolean, please check out the JavaScript data types chapter.
Boolean Properties
The following table lists the standard properties of the Boolean object.
Property | Description |
---|---|
prototype |
Allows you to add new properties and methods to a Boolean object. |
Note: Every object in JavaScript has a constructor
property that refers to the constructor function that was used to create the instance of that object.
Boolean Methods
The following table lists the standard methods of the Boolean object.
Method | Description |
---|---|
toString() |
Converts a Boolean value to a string, and returns the result. |
valueOf() |
Returns the primitive value of a Boolean object. |