forEach循环es6语法

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/github_37847992/article/details/78581428
var myArray=[
        {id:1,name:"a"},
        {id:2,name:"b"},
        {id:3,name:"c"},
        {id:4,name:"d"},
        ]
myArray.forEach((item,index)=>{
    console.log(item.id);
        //1,2,3,4,5
})

没有更多推荐了,返回首页