Set.prototype.entries()
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
实例的 entries()
方法返回一个新的 设置迭代器 对象,该对象包含此集合中每个元素的 [value, value]
数组(按插入顺序排列)。对于 Set
对象,没有像 Map
对象中那样的 key
。但是,为了保持 API 与 Map
对象相似,这里每个条目的键和值都具有相同的值,因此返回数组 [value, value]
。
¥The entries()
method of Set
instances returns a new set iterator object that contains an array of [value, value]
for each element in this set, in insertion order. For Set
objects there is no key
like in Map
objects. However, to keep the API similar to the Map
object, each entry has the same value for its key and value here, so that an array [value, value]
is returned.
Try it
语法
参数
返回值
示例
使用条目()
规范
Specification |
---|
ECMAScript Language Specification # sec-set.prototype.entries |
浏览器兼容性
BCD tables only load in the browser
也可以看看
¥See also