const arr =[{
id:'1',
name:'a'
},{
id:'2',
name:'b'
}];
arr.map(list => list.id); //['1','2']
本文深入探讨了JavaScript中数组的map方法使用技巧,通过具体示例展示了如何利用map方法遍历数组并返回新数组,特别关注了箭头函数在操作中的应用。
const arr =[{
id:'1',
name:'a'
},{
id:'2',
name:'b'
}];
arr.map(list => list.id); //['1','2']
2405
1558

被折叠的 条评论
为什么被折叠?
