Set.prototype.add()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
如果该集合中不存在具有相同值的元素,则 Set
实例的 add()
方法将具有指定值的新元素插入到该集合中
¥The add()
method of Set
instances inserts a new element with a specified value in to this set, if there isn't an element with the same value already in this set
Try it
语法
参数
返回值
示例
使用 add() 方法
规范
Specification |
---|
ECMAScript Language Specification # sec-set.prototype.add |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also