Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript find and update element from array

// Retrieve item and assign ref to updatedItem
let updatedItem = items.find((element) => { return element.id === item.id })

// Modify object property
updatedItem.aProp = ds.aProp
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #find #update #element #array
ADD COMMENT
Topic
Name
4+1 =