--- title: WeakSet.prototype slug: conflicting/Web/JavaScript/Reference/Global_Objects/WeakSet translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet translation_of_original: Web/JavaScript/Reference/Global_Objects/WeakSet/prototype original_slug: Web/JavaScript/Reference/Global_Objects/WeakSet/prototype ---
The WeakSet
.prototype
property represents the prototype for the {{jsxref("WeakSet")}} constructor.
{{jsxref("WeakSet")}} instances inherit from {{jsxref("WeakSet.prototype")}}. You can use the constructor's prototype object to add properties or methods to all WeakSet
instances.
WeakSet.prototype.constructor
WeakSet
对象中添加一个新元素 value
.WeakSet
对象中删除 value
这个元素, 之后 WeakSet.prototype.has(value)
方法便会返回 false
.value
是否存在于这个 WeakSet
中.Specification | Status | Comment |
---|---|---|
{{SpecName('ES6', '#sec-weakset.prototype', 'WeakSet.prototype')}} | {{Spec2('ES6')}} | Initial definition. |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }} | {{ CompatNo() }} {{bug(792439)}} | {{ CompatNo() }} | {{ CompatNo() }} | {{ CompatNo() }} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatNo() }} | {{ CompatNo() }} {{bug(792439)}} | {{ CompatNo() }} | {{ CompatNo() }} | {{ CompatNo() }} |
chrome://flags
, activate the entry “Enable Experimental JavaScript”.