一般有foreach,every,filter,map,some,还有es6新加的 reduce / reduceRight 和 find / findIndex   对低版本的浏览器的兼容不太好

1.

var arr = [1, 2, 3];

arr.forEach(function (element, index, array) {
  console.log(element, index, array)
})

//output
1 0 [1, 2, 3]
2 1 [1, 2, 3]
3 2 [1, 2, 3]
View Code

相关文章:

  • 2022-01-18
  • 2021-10-02
  • 2018-08-09
  • 2021-12-07
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案