Adds news Array.prototype methods groupBy() and groupByToMap() to perform a grouping or bucketing operation.

Motivation

From the proposal explainer: Array grouping is an extremely common operation, best exemplified by SQL's GROUP BY clause and MapReduce programming (which is better thought of map-group-reduce). The ability to combine like data into groups allows developers to compute higher order datasets, like the average age of a cohort or daily LCP values for a webpage.

Specification

Specification link


Specification currently under development in a Working Group

Status in Chromium

Blink>JavaScript>Language


In developer trial (Behind a flag) (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owner

Last updated on 2022-05-05