| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Exponentiation | [Back] [Original] |
Get to know MDN better
console.log(3 ** 4);
// Expected output: 81
console.log(10 ** -2);
// Expected output: 0.01
console.log(2 ** (3 ** 2));
// Expected output: 512
console.log((2 ** 3) ** 2);
// Expected output: 64
x ** y
a ** b ** c a ** (b ** c)
PHPPython ** + - Bash **
JavaScript +/-/~/!/delete/void/typeof
-2 ** 2 Bash 4 Python -4 JavaScript -(2 ** 2)
NaN ** 0 Math.pow(NaN, 0) NaN NaN 1base 1 exponent Infinity NaN IEEE 754 IEEE 754 1 JavaScript NaN
2 ** 3; // 8
3 ** 2; // 9
3 ** 2.5; // 15.588457268119896
10 ** -1; // 0.1
NaN ** 2; // NaN
NaN ** 0; // 1
1 ** Infinity; // NaN
2 ** 3 ** 2; // 512
2 ** (3 ** 2); // 512
(2 ** 3) ** 2; // 64
-(2 ** 2); // -4
(-2) ** 2; // 4
| ECMAScript 2027 LanguageSpecification # sec-exp-operator |
| Web Proxy Viewer | New URL | Original Page |