change value of each property of object array javascript

Solutions on MaxInterview for change value of each property of object array javascript by the best coders in the world

showing results for - "change value of each property of object array javascript"
Logan
18 Sep 2018
1let yourArray = [{id:3},{id:2},{id:4}] 
2 yourArray.forEach((item, index) => { 
3 item.id = index 
4})