Iterable迭代


遍历数组

// 通过for of / for in 下标
var arr = [3, 4, 5];
for(var x of arr){
    console.log(x)
}

遍历map

var map = new Map([["tom", 100], ["jack", 90], ["haha", 80]]);
for(let x of map){
    console.log(x)
}

遍历set

var set = new Set([5, 6, 7]);
for(let x of set){
    console.log(x)
}