Symbol.prototype 表示 Symbol 构造函数的原型。.
Description
Symbol.prototype. 你可以使用构造函数的原型对象来给所有Symbol实例添加属性或者方法。
Symbol.prototype 属性的属性特性: |
|
|---|---|
| writable | false |
| enumerable | false |
| configurable | false |
Properties
-
Symbol.prototype.constructor -
返回创建实例原型的函数. 默认为
Symbol函数。 -
Symbol.prototype.description - 一个包含symbol描述的只读字符串。
Methods
-
Symbol.prototype.toSource() -
返回包含
Symbol对象源码的字符串。覆盖Object.prototype.toSource()方法。 -
Symbol.prototype.toString() -
返回包含Symbol描述符的字符串。 覆盖
Object.prototype.toString()方法。 -
Symbol.prototype.valueOf() -
返回
Symbol对象的初始值.。覆盖Object.prototype.valueOf()方法。 -
Symbol.prototype[@@toPrimitive] -
返回
Symbol对象的初始值。
Specifications
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) Symbol.prototype |
Standard | Initial definition. |
| ECMAScript Latest Draft (ECMA-262) Symbol.prototype |
Draft |
浏览器兼容
Update compatibility data on GitHub
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
prototype |
Chrome Full support 38 | Edge Full support 12 | Firefox Full support 36 | IE No support No | Opera Full support 25 | Safari Full support 9 | WebView Android Full support 38 | Chrome Android Full support 38 | Firefox Android Full support 36 | Opera Android Full support 25 | Safari iOS Full support 9 | Samsung Internet Android Full support 3.0 | nodejs Full support Yes |
Legend
- Full support
- Full support
- No support
- No support