Class Boolean
Provides support for boolean values.
Constructor Summary
| Constructor | Description |
|---|
| Boolean(String) | Constructs the Boolean using the specified String value. |
| Boolean(Number) | Constructs the Boolean using the specified Number value. |
Method Summary
| Method | Description |
|---|
| toString() | Returns true or false depending on the value used to create the Boolean. |
| valueOf() | Returns the primitive boolean contained in the Boolean object. |
Methods inherited from class Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Constructor Details
Boolean(String)
- Boolean(value: String)
Constructs the Boolean using the specified
String value.
Parameters:
- value - the String value to use to construct the Boolean. If value is null or an empty String, the Boolean is set to false.
Boolean(Number)
- Boolean(value: Number)
Constructs the Boolean using the specified
Number value.
Parameters:
- value - the Number value to use to construct the Boolean. If value is null or 0, the Boolean is set to false.
Method Details
toString()
- toString(): String
Returns true or false depending on the value used to create
the Boolean.
Returns:
- true or false depending on the value used to create
the Boolean.
valueOf()
- valueOf(): Object
Returns the primitive boolean contained in the Boolean
object.
Returns:
- the primitive boolean contained in the Boolean
object.