Codog

关注微信公众号:Codog代码狗

0%

Iterator与for...of

原生具备 Iterator 接口的数据结构如下。

Array
Map
Set
String
TypedArray
函数的 arguments 对象

1
2
3
4
5
6
function test(){
for(let arg of arguments){
console.log(arg)
}
}
test(1,2,3) // 1 2 3

NodeList 对象