Answers for "find in array and change"

0

find in array and change

var item = {...}
var items = [{id:2}, {id:2}, {id:2}];

var foundIndex = items.findIndex(x => x.id == item.id);
items[foundIndex] = item;
Posted by: Guest on May-29-2021

Code answers related to "find in array and change"

Browse Popular Code Answers by Language