Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS map change values

const updatedData = originalData.map(x => (x.id === id ? { ...x, updatedField: 1 } : x));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JS #map #change #values
ADD COMMENT
Topic
Name
5+6 =