数组中对象添加新属性
javascript
let person = [
{ id: 1,name: 'vhen'},
{ id: 2,name: 'json'}
]
let newArr = obj.map((item, index) => {
return Object.assign(item, { index: index })
})