Created
April 6, 2020 15:50
-
-
Save juanigaray/1d174cac2b40f20b9e477456b2a79bc0 to your computer and use it in GitHub Desktop.
Lodash set nested value in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can test this here: https://codepen.io/travist/full/jrBjBz/ | |
var users = [ | |
{ user: 'barney', age: 36, active: true }, | |
{ user: 'fred', age: 40, active: false }, | |
{ user: 'travis', age: 37, active: true} | |
]; | |
result = _.set(users, "0.user", "asd"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment