I have to arrays of objects arr1 = [....] arr2 = [....]
now i'd like to find matching object based of it's id and then copy the values from one to another I made this using for loops:
for (let newCampaignState of data) {
for (let oldCampaignState of this.campaigns) {
if (oldCampaignState.id === newCampaignState.id) {
oldCampaignState.name = newCampaignState.name;
}
}
}
how could i do this using more functional programming?