📜  for in 和 for of in js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:14.603000             🧑  作者: Mango

代码示例6
let iterable = new Map([["a", 1], ["b", 2], ["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