WeakSet.prototype
WeakSet.prototype
该属性表示构造函数的原型。WeakSet.prototypeWeakSet
| WeakSet.prototype 的属性|
|:----|
| Writable | no |
| Enumerable | no |
| Configurable | no |
描述
WeakSet
实例继承自WeakSet.prototype
。您可以使用构造函数的原型对象为所有WeakSet
实例添加属性或方法。
WeakSet.prototype
本身就是一个普通的对象:
Object.prototype.toString.call(WeakSet.prototype // "[object Object]"
属性
WeakSet.prototype.constructor
返回创建实例原型的函数。这是WeakSet
默认的功能。
方法
WeakSet.prototype.add(value)
在该 WeakSet
对象中添加一个新元素value
.
规范
Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'WeakSet.prototype' in that specification. | Standard | Initial definition. |
ECMAScript Latest Draft (ECMA-262)The definition of 'WeakSet.prototype' in that specification. | Living Standard | |
浏览器兼容性
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 36 | (Yes) | 34 (34) | No support | 23 | No support |
Feature | Chrome for Android | Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | No support | No support | (Yes) | 34.0 (34) | No support | No support | No support |