Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

WeakSet.prototype

这篇翻译不完整。请帮忙从英语翻译这篇文章

该特性处于 ECMAScript 6 规范草案中,目前的实现在未来可能会发生微调,请谨慎使用。

Summary

The WeakSet.prototype property represents the prototype for the WeakSet constructor.

WeakSet.prototype 属性的属性特性:
writable false
enumerable false
configurable false

Description

WeakSet instances inherit from 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.clear()
清空该 WeakSet 对象中的所有元素.
WeakSet.prototype.delete(value)
该 WeakSet 对象中删除 value 这个元素, 之后 WeakSet.prototype.has(value) 方法便会返回 false.
WeakSet.prototype.has(value)
返回一个布尔值,  表示给定的值 value 是否存在于这个 WeakSet 中.

Specifications

Specification Status Comment
ECMAScript 6 (ECMA-262)
WeakSet.prototype
Release Candidate Initial definition.

Browser compatibility

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”.

See also

文档标签和贡献者

 此页面的贡献者: teoli, ziyunfei
 最后编辑者: teoli,