Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript find object in array and replace it

 const updatedData = originalData.map(x => (x.id === id ? { ...x, updatedField: 1 } : x));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #find #object #array #replace
ADD COMMENT
Topic
Name
9+1 =