I want to compare two array in that i want to change value of matching id.
Please refer bellow array's and result.
let array1 =[
{
"id": 1,
"value": false
},
{
"id": 2,
"value": false
},
{
"id": 3,
"value": true
},
{
"id": 4,
"value": false
}
]
let array2 = [
{
"id": 1
},
{
"id": 4
}
]
I want to use underscore library to compare this arrays and return the compare array value result as like below array
result = [
{
"id": 1,
"value": true
},
{
"id": 2,
"value": false
},
{
"id": 3,
"value": true
},
{
"id": 4,
"value": true
}
]