i have this array
const input = [
{ StockKeepingUnit: 'SKU-001', Quantity: 3 },
{ StockKeepingUnit: 'SU-002', Quantity: 5 },
{ StockKeepingUnit: 'SU-002', Quantity: 7 },
{ StockKeepingUnit: 'SKU-d7', Quantity: 2 },
{ StockKeepingUnit: 'SKU-d7', Quantity: 4 },
{ StockKeepingUnit: 'sku-899', Quantity: 1 },
{ StockKeepingUnit: 'SU-002', Quantity: 1 },
{ StockKeepingUnit: 'SU-002', Quantity: 2 },
];
but I would like for it to be like this
const input = [
{ StockKeepingUnit: 'SKU-001', Quantity: 3 },
{ StockKeepingUnit: 'SU-002', Quantity: 15 },
{ StockKeepingUnit: 'SKU-d7', Quantity: 6 },
{ StockKeepingUnit: 'sku-899', Quantity: 1 },
];
So reduce the array but add the quantities together, please, this is driving me crazy. Thank you!