📜  foreach 循环 javascript 代码示例

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

代码示例6
var array = ["a","b","c"];
// example 1
  for(var value of array){
    console.log(value);
    value += 1;
  }

// example 2
  array.forEach((item, index)=>{
    console.log(index, item)
  })