var inputArr = [{
name: "Smith",
points: 50
},
{
name: "Rock",
points: 27
},
{
name: "John",
points: 50
},
{
name: "Rock",
points: 800
},
{
name: "Smith",
points: 20
},
{
name: "John",
points: 80
}]
outputArr = {
"Smith" : 70,
"JOhn" : 130,
"Rock" : 827
}
name should be unique, and unique name points should be consolidated. Ex : We have 2 number Smith with different points with 50 and 20. so result should be {"smith" : 70}