JavaScript Boolean.valueOf()
Example
Return the primitive value of a Boolean object:
let bool = false;
bool.valueOf() //Returns false
Try it Yourself »
Definition and Usage
The valueOf() method returns the primitive value of a boolean.
valueOf() is usually called by
JavaScript behind the scenes, and not explicitly in code.
Browser Support
Boolean.valueOf() is fully supported in all browsers:
| Chrome | IE | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
boolean.valueOf()
Parameters
| None |
Technical Details
| Return Value: | A Boolean, either true or false |
|---|---|
| JavaScript Version: | ECMAScript 1 |
Related Pages
JavaScript Tutorial: JavaScript Booleans
JavaScript Tutorial: JavaScript Data Types

