I have the below array of objects. if i do a console.log, i see this
[Object, Object, Object]
0:Object
name: "Rick"
Contact: "Yes"
1:Object
name:"Anjie"
Contact:"No"
2:Object
name:"dillan"
Contact:"Maybe"
I want the above array of object to be updated like this.
[Object, Object, Object]
0:Object
name: "Rick"
Contact: "Yes"
id: 1
1:Object
name:"Anjie"
Contact:"No"
id: 2
2:Object
name:"dillan"
Contact:"Maybe"
id:3
As you can see, i have added id and it auto increments whenever a new object is present.
Can someone let me know how to do this dynamically ?