W3cubDocs

/JavaScript

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

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Exponentiation assignment (x **= y) 52 14 52 No 39 10.1
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
Exponentiation assignment (x **= y) 51 52 52 41 10.3 6.0
Server
Node.js
Exponentiation assignment (x **= y) 7.0.0
7.0.0
6.5.0
Disabled
Disabled From version 6.5.0: this feature is behind the --harmony runtime flag.

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation_assignment