arr:[ {
id:'111',
name:'sdfaf'
},{
id:'122',
name:'sretf'
} ]
const newArr = arr.map(item=>{
return Object.assign({},{'id':item.id})
})
打印newArr
arr:[ {
id:'111',
name:'sdfaf'
},{
id:'122',
name:'sretf'
} ]
const newArr = arr.map(item=>{
return Object.assign({},{'id':item.id})
})
打印newArr