I have a array like this:
let data = [
{
name: 'foo',
score: 10,
},
{
name: 'bar',
score: 20
},
{
name: 'foo',
score: 15,
},
];
Now this represents a track records of scores by player. I want to get the highest score of each player. How can I achieve this? I tried different combinations of filters and I can't find a way without iterating multiple times over the array.