coderef

Array groupingBaseline · Widely available

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.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 5, 2024. Widely available since Sep 5, 2026.

Browser support

DesktopChrome
1–116Not supported
117+Supportedsince Sep 12, 2023
Current: 155
Edge
12–116Not supported
117+Supportedsince Sep 15, 2023
Current: 154
Firefox
1–118Not supported
119+Supportedsince Oct 24, 2023
Current: 157
Safari
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27
MobileChrome Android
18–116Not supported
117+Supportedsince Sep 12, 2023
Current: 155
Firefox Android
4–118Not supported
119+Supportedsince Oct 24, 2023
Current: 157
Safari iOS
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: groupBy.

Feature detection

JS · check before using
if ("groupBy" in Map || ("prototype" in Map && "groupBy" in Map.prototype)) {
  // Map.groupBy is available
}

Documentation (MDN)

Specification

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Map.groupBy11711711917.411711917.4
Object.groupBy11711711917.411711917.4