Boolean.prototype.valueOf()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
valueOf()
方法返回一个Boolean
对象的原始值。
尝试一下
语法
bool.valueOf()
返回值
给定Boolean
对象的原始值
描述
示例
使用 valueOf
js
x = new Boolean();
myVar = x.valueOf(); // assigns false to myVar
规范
Specification |
---|
ECMAScript Language Specification # sec-boolean.prototype.valueof |
浏览器兼容性
BCD tables only load in the browser