代码
提交代码
let iterable = new Map() iterable.set('a', 1) iterable.set('b', 2) iterable.set('c', 3) for (let entry of iterable) { console.log(entry) } // ['a', 1] // ['b', 2] // ['c', 3] for (let [key, value] of iterable) { console.log(value) } // 1 // 2 // 3
运行结果