I wonder if there is a simpler method in lodash to replace an item in a JavaScript collection? (Possible duplicate but I did not understand the answer there:)
I look
If you're just trying to replace one property, lodash _.find and _.set should be enough:
_.find
_.set
var arr = [{id: 1, name: "Person 1"}, {id: 2, name: "Person 2"}]; _.set(_.find(arr, {id: 1}), 'name', 'New Person');