Is there a way to update a single field in an object within an array of objects?
PeopleList= [
{id:1, name:"Mary", active:false},
{id:2, name:"John", active:false},
{id:3, name:"Ben", active:true}]
For instance, setting John's active to true.
I tried to do this in Lodash but it doesn't return a proper result. It returns a lodash wrapper.
updatedList = _.chain(PeopleList)
.find({name:"John"})
.merge({active: true});