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 Object]"


Returns the function that created an instance's prototype. This is the WeakSet function by default.


Appends a new object with the given value to the WeakSet object.
Removes the element associated to the value. WeakSet.prototype.has(value) will return false afterwards.
Returns a boolean asserting whether an element is present with the given value in the WeakSet object or not.
Removes all elements from the WeakSet object.


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.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
Basic supportChrome Full support 36Edge Full support YesFirefox Full support 34IE No support NoOpera Full support 23Safari Full support 9WebView Android Full support 37Chrome Android Full support 36Edge Mobile Full support YesFirefox Android Full support 34Opera Android Full support 23Safari iOS Full support 9Samsung Internet Android Full support Yesnodejs Full support 0.12


Full support  
Full support
No support  
No support

See also

Document Tags and Contributors

Last updated by: mdnwebdocs-bot,