I have an array of objects that contains categories and points. I want to sum each category's points.
{
category: A,
points:2
},
{
category: A
points: 3
},
{
category: B,
points:2
},
{
category: B
points: 3
}
]
How can I sum points from category A and points from category B in the slickest way possible ?