这篇翻译不完整。请帮忙从英语翻译这篇文章。
概述
Boolean.prototype
属性表示 Boolean
构造函数的原型。
Boolean.prototype 属性的属性特性: |
|
---|---|
writable | false |
enumerable | false |
configurable | false |
描述
Boolean
实例继承自 Boolean.prototype
。可以通过添加属性或方法到布尔构造函数的原型对象上来给所有布尔实例添加。
属性
Boolean.prototype.constructor
- 返回创建了实例原型的函数。默认为
Boolean
函数。
方法
Boolean.prototype.toSource()
- Returns a string containing the source of the
Boolean
object; you can use this string to create an equivalent object. Overrides theObject.prototype.toSource()
method. Boolean.prototype.toString()
- 依据布尔对象的值来返回一个字符串:"true" 或 "false"。覆盖了
Object.prototype.toString()
方法。 Boolean.prototype.valueOf()
- 返回
Boolean
对象的原始值(primitive value)。覆盖了Object.prototype.valueOf()
方法。
规范
规范版本 | 规范状态 | 注解 |
---|---|---|
ECMAScript 1st Edition. Implemented in JavaScript 1.0 | Standard | Initial definition. |
ECMAScript 5.1 (ECMA-262) Boolean.prototype |
Standard | |
ECMAScript 6 (ECMA-262) Boolean.prototype |
Release Candidate |
浏览器兼容性
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |