Exponentiation assignment (**=)
The exponentiation assignment operator (**=
) raises the value of a
variable to the power of the right operand.
Syntax
x **= y // x = x ** y
Examples
Using exponentiation assignment
// Assuming the following variable
// bar = 5
bar **= 2 // 25
bar **= 'foo' // NaN
Specifications
Specification |
---|
ECMAScript Language Specification # sec-assignment-operators |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Exponentiation assignment ( x **= y ) | ChromeFull support52 | EdgeFull support14 | FirefoxFull support52 | Internet ExplorerNo supportNo | OperaFull support39 | SafariFull support10.1 | WebView AndroidFull support51 | Chrome AndroidFull support52 | Firefox for AndroidFull support52 | Opera AndroidFull support41 | Safari on iOSFull support10.3 | Samsung InternetFull support6.0 | DenoFull support1.0 | Node.jsFull support7.0.0 |
Legend
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.