this is my data
let a = [
{
"activityCode": "23",
"isValid": null
},
{
"activityCode": "28",
"isValid": null
},
{
"activityCode": "32",
"isValid": null
}
]
let b = [
{
"activityCode": "23",
"allocated": 3
},
{
"activityCode": "32",
"allocated": 2
}
]
i want to change "isValid" to true if activityCode(a) in array has the same activityCode(b) & "isValid" to false if activityCode(a) in array has not the same activityCode(b), and the output i need like this:
let a = [
{
"activityCode": "23",
"isValid": true
},
{
"activityCode": "28",
"isValid": false
},
{
"activityCode": "32",
"isValid": true
}
]
Please help me. thanks guys.