coderef

Stable array sortBaseline · Widely available

Stable array sort() function

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jan 15, 2020. Widely available since Jul 15, 2022.

Browser support

DesktopChrome
1–69Not supported
70+Supportedsince Oct 16, 2018
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–2Not supported
3+Supportedsince Jun 17, 2008
Current: 157
Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27
MobileChrome Android
18–69Not supported
70+Supportedsince Oct 17, 2018
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1–10Not supported
10.3+Supportedsince Mar 27, 2017
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 — see the links below.

Feature detection

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