The WeakSet
.prototype
property represents the prototype for the WeakSet
constructor.
Property attributes of WeakSet.prototype
| |
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
WeakSet
instances inherit from WeakSet.prototype
. You can use the constructor's prototype object to add properties or methods to all WeakSet
instances.
WeakSet.prototype
is itself just an ordinary object:
Object.prototype.toString.call(WeakSet.prototype); // "[object Object]"
WeakSet.prototype.constructor
WeakSet
function by default.WeakSet.prototype.add(value)
WeakSet
object.WeakSet.prototype.delete(value)
value
. WeakSet.prototype.has(value)
will return false
afterwards.WeakSet.prototype.has(value)
WeakSet
object or not.WeakSet.prototype.clear()
WeakSet
object.Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'WeakSet.prototype' in that specification. | Standard | Initial definition. |
ECMAScript 2017 Draft (ECMA-262) The definition of 'WeakSet.prototype' in that specification. | Draft |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 36 | 34 (34) | No support | 23 | No support |
Ordinary object | ? | 40 (40) | ? | ? | ? |
Feature | Chrome for Android | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | No support | No support | 34.0 (34) | No support | No support | No support |
Ordinary object | ? | ? | 40.0 (40) | ? | ? | ? |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet/prototype