I\'ve got an array of objects and I need a function that finds object an array by the objects property (id in example) and changes its other property (name
id
name
Use this instead of filter. Filter produce new array.
arrayOfObjects.forEach(function(v){ if (v.id == id) {v.name = newName} });