I have an array and an object that has an array as one of its keys. I want to use Lodash to merge the array into the object replace its array. Here is the code...
array1 = [false, true, true];
object1 = {
id: 1,
label: 'lorem',
description: "ipsum",
users: [
{
id: 1,
user: 'morbi',
checked: true
},
{
id: 2,
user: 'mauris',
checked: true
},
{
id: 3,
user: 'duis',
checked: true
}
]
}
What I want to do is have the booleans in array1 replace the "checked" booleans in the users array in object1. I want to use Lodash to do this since it seems like it would be much easier, but if there's another way, I'm open to that.
Any suggestions?