1.数组循环 介绍数组循环之前,先回顾一下ES5数组的循环 (1)数组遍历(代替普通的for):arr.forEach(callback(val,index,arr){todo}) //val是数组的当前项,index是数组的键名(下标),arr是整个数组 let arr = ['today','tomorrow','the day after tommrrow','three days from now']; arr.forEach(function(val,index,arr){ conso…