数组.foreach(数组中的每一项,下标)=>{}
例如:
let arr=[
{id:1,name:'张三'},
{id:2,name:'李四'},
{id:3,name:'王五'}
]
arr.foreach(item,index)=>{
console.log(item.id) //1,2,3
}