The new array group proposal introduces new methods array.groupBy() and array. groupByToMap(). Their polyfills are available in core-js library. The method groupBy() requires less code and is easier to understand than using product.reduce() . The Map() method accepts any data type a key.
1 Comment
Sort: