Answers for "javascript set property for each object in array of objects"

0

javascript set property for each object in array of objects

let yourArray = [{id:3},{id:2},{id:4}] 
 yourArray.forEach((item, index) => { 
 item.id = index 
})
Posted by: Guest on July-06-2020

Code answers related to "javascript set property for each object in array of objects"

Code answers related to "Javascript"

Browse Popular Code Answers by Language