0

I am trying to add the values of data with similar keys of two or more rows in JavaScript shown below:

[{name: 'Co', phonenumber: '754', commission: 180}
 {name: 'Co', phonenumber: '754', commission: 0}
 {name: 'Co', phonenumber: '715', commission: 180}
 {name: 'Co', phonenumber: '715', commission: 50}]

So, the result I want is below:

[{name: 'Co', phonenumber: '754', commission: 180}
 {name: 'Co', phonenumber: '715', commission: 230}]

commission property should add and rest will be merged. Thanks

  • Maybe [my answer](https://stackoverflow.com/questions/19233283/sum-javascript-object-propertya-values-with-the-same-object-propertyb-in-an-arra/76616118#76616118) could help you! – XMehdi01 Jul 04 '23 at 22:25

0 Answers0