Table of contents
- 1. Summary
- 2. Syntax
- 3. Parameters
- 4. Description
- 5. Examples
- 6. See Also
Summary
Returns the primitive value of a Boolean object.
Method of Boolean | |
|---|---|
| Implemented in | JavaScript 1.1 |
| ECMAScript Edition | ECMAScript 1st Edition |
Syntax
bool.valueOf()
Parameters
None.
Description
The valueOf method of Boolean returns the primitive value of a Boolean object or literal Boolean as a Boolean data type.
This method is usually called internally by JavaScript and not explicitly in code.
Examples
Example: Using valueOf
x = new Boolean(); myVar = x.valueOf() //assigns false to myVar