Array grouping
Newly available since 2024-03-05
The Object.groupBy()
and Map.groupBy()
static methods group values of arrays and iterables based on a function that returns a key for each value.
Learning resources on MDN
Browser support
- Chrome 117 Released on 2023-09-12
- Chrome Android 117 Released on 2023-09-12
- Edge 117 Released on 2023-09-15
- Firefox 119 Released on 2023-10-24
- Firefox for Android 119 Released on 2023-10-24
- Safari 17.4 Released on 2024-03-05
- Safari on iOS 17.4 Released on 2024-03-05
Specifications
- ECMAScript Language Specification (#sec-groupby), from TC39 (Ecma International).