Group by in Javascript using reduce
问题 I struggled finding the solution I was looking for in other stackoverflow posts, even though I strongly feel as if it must exist. If it does, please do forward me in the right direction. I am trying to do a pretty standard group by in javascript using sports data. I have the following array of objects: const myData = [ {team: "GSW", pts: 120, ast: 18, reb: 11}, {team: "GSW", pts: 125, ast: 28, reb: 18}, {team: "GSW", pts: 110, ast: 35, reb: 47}, {team: "HOU", pts: 100, ast: 17, reb: 43},