Have first array (a) and second with updated values (b). Need to update matching by IDs objects and get result array (c). How can I make it simple and fast?
let a = [
{ id: 1, activated: '0' },
{ id: 2, activated: '0' },
{ id: 3, activated: '0' },
{ id: 4, activated: '0' },
]
let b = [
{ id: 2, activated: '1' },
{ id: 3, activated: '1' },
]
//Result array:
c = [
{ id: 1, activated: '0' },
{ id: 2, activated: '1' },
{ id: 3, activated: '1' },
{ id: 4, activated: '0' },
]