DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
9+1 =
Submit