Summary
The WeakSet.prototype property represents the prototype for the WeakSet constructor.
WeakSet.prototype 属性的属性特性: |
|
|---|---|
| writable | false |
| enumerable | false |
| configurable | false |
Description
WeakSet.prototype. You can use the constructor's prototype object to add properties or methods to all WeakSet instances.
Properties
-
WeakSet.prototype.constructor -
返回构造函数即
WeakSet本身.
Methods
-
WeakSet.prototype.add(value) -
在
该
WeakSet对象中添加一个新元素value. -
WeakSet.prototype.delete(value) -
从
该
WeakSet对象中删除value这个元素, 之后WeakSet.prototype.has(value)方法便会返回false. -
WeakSet.prototype.has(value) -
返回一个布尔值, 表示给定的值
value是否存在于这个WeakSet中.
Specifications
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) WeakSet.prototype |
Standard | Initial definition. |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains.
Find out how you can help!
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | 未实现 bug 792439 | 未实现 | 未实现 | 未实现 |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | 未实现 | 未实现 bug 792439 | 未实现 | 未实现 | 未实现 |
Chrome-specific notes
- This feature is available behind a preference. In
chrome://flags, activate the entry “Enable Experimental JavaScript”.