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.

3m read timeFrom dmitripavlutin.com
Post cover image
Table of contents
1. array.groupBy()2. array.groupByToMap()3. Conclusion
1 Comment

Sort: