i need to update the array of objects based on another array in ES6. Example
let a = [
{ id : 23, active :false, status:"" },
{ id : 33, active :false, status:"" },
{ id : 167, active :false, status:"" },
{ id : 18, active :false, status:"" },
{ id : 200, active :false, status:"" },
]
my second array which contain the objects
let marked = [167,33,23];
expected results as below
let a = [
{ id : 23, active :true, status:"updated"},
{ id : 33, active :true, status:"updated" },
{ id : 167, active :true, status:"updated" },
{ id : 18, active :false, status:"" },
{ id : 200, active :false, status:"" },
]
please let me know how to get as expected result. do we have any other methods in lodash for this.?