首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

WeakSet.prototype

该属性表示构造函数的原型。WeakSet.prototypeWeakSet

| WeakSet.prototype 的属性|

|:----|

| Writable | no |

| Enumerable | no |

| Configurable | no |

描述

WeakSet实例继承自WeakSet.prototype。您可以使用构造函数的原型对象为所有WeakSet实例添加属性或方法。

WeakSet.prototype 本身就是一个普通的对象:

代码语言:javascript
复制
Object.prototype.toString.call(WeakSet.prototype); // "[object Object]"

属性

WeakSet.prototype.constructor返回创建实例原型的函数。这是WeakSet默认的功能。

方法

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

规范

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.

Living Standard

?

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

36

(Yes)

34 (34)

No support

23

No support

Feature

Chrome for Android

Android

Edge

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

No support

No support

(Yes)

34.0 (34)

No support

No support

No support

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com