for就不用说了最普通的循环函数forEach1. 只写 1 个参数只接收当前遍历元素let arr [10,20,30] arr.forEach(item { console.log(item) // 依次 10、20、30 })2. 写 2 个参数依次接收元素值、下标索引let arr [10,20,30] arr.forEach((item, index) { console.log(index, item) // 0 10 // 1 20 // 2 30 })3. 补充第三个参数第三个参数为原始数组本身arr.forEach((item, index, arr){})return的区别for循环可以正常返回值外部也可以正常接受返回值并结束循环但是forEachwu无法返回任何东西虽然不会报错但是无论内部还是外部都无法有返回值只能用来结束循环