Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update object within object by id js

//This will replace myId of the item id with the updated object

return myArray.map((item) => {
	return item.id === myId
		? UPDATED_OBJECT_HERE
		: item;
});
 
PREVIOUS NEXT
Tagged: #update #object #object #id #js
ADD COMMENT
Topic
Name
7+3 =