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
Best helpers
John Weisz
+5
Jean Luis
+5
Terry3497
+5
Aown Ali
+5
Ishan Yadav
+5
SunnyHills
+5
Rocky DeHart
+5
Numeri
+5
Martinako
+5
Eve noonan
+5
Cynthia
+5