I want to update (replace) the objects in my array with the objects in another array. Each object has the same structure. e.g.
var origArr = [
You can use a hash which gives the index by name, and Object.assign to update.
Object.assign
var hash = origArr.reduce(function(hash, obj, index) { hash[obj.name] = index; return hash; }, Object.create(null)); for(var obj of updatingArr) { Object.assign(origArr[hash[obj.name]], obj); }