I am looking to create a new array that combines values of repeated campaigns
let arrayName = [
{ campaign: "a", value: 3 },
{ campaign: "b", value: 5 },
{ campaign: "c", value: 7 },
{ campaign: "a", value: 9 },
];
EXPECTED OUTPUT:
[
{ campaign: 'a', value: 12 },
{ campaign: 'b', value: 5 },
{ campaign: 'c', value: 7 }
]