I have data in this structure coming from my Node into my React.
[
{Field: Data, WinningPlayer: "Name1", Points: 3}
{Field: Data, WinningPlayer: "Name2", Points: 8}
{Field: Data, WinningPlayer: "Name1", Points: 4}
{Field: Data, WinningPlayer: "Name2", Points: 2}
]
How do I group on WinningPlayer and then sum the values for that player. I have gone through a few of the posts, but I am unable to understand how to use reduce or any other array function. Can someone please help?