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