coderef

Exponentiation operatorBaseline · Widely available

The exponentiation (**) operator returns the result of raising the first operand to the power of the second operand.

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

Browser support

DesktopChrome
1–51Not supported
52+Supportedsince Jul 20, 2016
Current: 155
Edge
12–13Not supported
14+Supportedsince Aug 2, 2016
Current: 154
Firefox
1–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157
Safari
1–10Not supported
10.1+Supportedsince Mar 27, 2017
Current: 27
MobileChrome Android
18–51Not supported
52+Supportedsince Jul 27, 2016
Current: 155
Firefox Android
4–51Not supported
52+Supportedsince Mar 7, 2017
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: Exponentiation.

Feature detection

JS · check before using
// Syntax can't be tested with an if-statement — an unsupported
// browser fails to parse the whole script. Either transpile for older
// targets (e.g. Babel/TypeScript/esbuild), or probe in isolation:
let supported = true;
try {
  new Function("/* code that uses the syntax */");
} catch {
  supported = false;
}

This is a language syntax feature.

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
exponentiation52145210.1525210.3
exponentiation_assignment52145210.1525210.3