Exponentiation assignment (**=)

The exponentiation assignment operator (**=) raises the value of a variable to the power of the right operand.

Syntax

Operator: x **= y
Meaning:  x  = x ** y

Examples

Using exponentiation assignment

// Assuming the following variable
//  bar = 5

bar **= 2     // 25
bar **= 'foo' // NaN

Specifications

Specification
ECMAScript (ECMA-262)
The definition of 'Assignment operators' in that specification.

Browser compatibility

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
Exponentiation assignment (x **= y)Chrome Full support 52Edge Full support 14Firefox Full support 52IE No support NoOpera Full support 39Safari Full support 10.1WebView Android Full support 51Chrome Android Full support 52Firefox Android Full support 52Opera Android Full support 41Safari iOS Full support 10.3Samsung Internet Android Full support 6.0nodejs Full support 7.0.0
Full support 7.0.0
Full support 6.5.0
Disabled
Disabled From version 6.5.0: this feature is behind the --harmony runtime flag.

Legend

Full support  
Full support
No support  
No support
User must explicitly enable this feature.
User must explicitly enable this feature.

See also