Set.prototype

Set.prototype

Set.prototype属性表示Set构造器的原型。

| Set.prototype 属性的属性特性 |

|:----|

| Writable | no |

| Enumerable | no |

| Configurable | no |

描述

Set示例继承于Set.prototype。你可以用构造器的原型对象给所有Set示例添加属性或方法。

参数

Set.prototype.constructor返回实例的构造函数。默认情况下是Set

方法

Set.prototype.add(value)Set对象尾部添加一个元素。返回该Set对象。

规范

SpecificationStatusComment
ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'Set.prototype' in that specification.StandardInitial definition.
ECMAScript Latest Draft (ECMA-262)The definition of 'Set.prototype' in that specification.Living Standard

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support38(Yes)13 (13)11257.1

FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNo support38(Yes)13.0 (13)No supportNo support8