Boolean.valueOf

valueOf — Returns the primitive value of a Boolean object.

Description

Boolean.valueOf()

Examples

Example #1 – valueOf example
var b = new Boolean(false); console.log(typeof b.valueOf()); // Will return "boolean". console.log(b.valueOf()); // Will be the boolean value: false if (b) { // Will always be executed. } if (b.valueOf()) { // Will only be executed if the value of the boolean is set to true. }

External references