What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-09 13:28:14
how to update whole object in array using lodash
var arr = [{id: 1, name: "Person 1"}, {id:2, name:"Person 2"}]; // Find item index using _.findIndex (thanks @AJ Richardson for comment) var index = _.findIndex(arr, {id: 1}); // Replace item at index using native splice arr.splice(i... Add solution