Exponentiation operator
The exponentiation (**) operator returns the result of raising the first operand to the power of the second operand.
Overview
The exponentiation (**) operator returns the result of raising the first operand to the power of the second operand.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 52 | 14 | 52 | 10.1 | 52 | 10.3 | |
| Other | ||||||
| The exponentiation assignment (=)** operator performs exponentiation on the two operands and assigns the result to the left operand. | 52 | 14 | 52 | 10.1 | 52 | 10.3 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
JAVASCRIPT
2 ** 3; // 8
2 ** 10; // 1024
10 ** -2; // 0.01
// Equivalent to Math.pow()
Math.pow(2, 3); // 8 Live demo
area and volume. Calculation
one. length from, positivesideshape. area(2power) and sidebody. volume(3power) calculated..
PreviewFullscreen
compoundcalculation
sourcegold,, periodbetween from compound. calculation..(sourcegold * (1 + rate) ** periodbetween).
PreviewFullscreen
Use cases
Using Exponentiation operator
The exponentiation (**) operator returns the result of raising the first operand to the power of the second operand.
Cautions
- No specific concerns. Stable across all major browsers.
Accessibility
- When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.
Related links
Powered by web-features