Grouping an array of objects by key
With the help of array.reduce, the Map data structure and higher-order functions you can do a lot in JavaScript, for example a generic groupBy function for an array of objects.
LinkWith the help of array.reduce, the Map data structure and higher-order functions you can do a lot in JavaScript, for example a generic groupBy function for an array of objects.
Link