let person =[{
id: 1,
name: 'vhen'
},{

id: 2,
name: 'json'
}]

let newArr = obj.map((item,index) =>{
return Object.assign(item,{index:index})
})