JavaScripture
Contribute via GitHub Feedback

Boolean : Object

A true or false value.

Boolean(value : Object) : Boolean

Coerces value into a boolean value. You can also use !!value to do the coercion. Note 'false' coerces to true since it is a non-empty string. Use value === 'true' to convert a string to a Boolean.

Example:

Run

Results:

 

Constructors

new Boolean(value : Object) : Object

Creates a box for a boolean value.

Example:

Run

Results:

 

Instance Methods

toString() : String

Returns a string representation of this.

Example:

Run

Results: