The Math.pow() method returns the value of x to the power of y (xy).
let a = Math.pow(0, 1);
let b = Math.pow(1, 1);
let c = Math.pow(1, 10);
let d = Math.pow(3, 3);
let e = Math.pow(-3, 3);
let f = Math.pow(2, 4);
Try it Yourself »
Math.pow()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
Math.pow(
x,
y)
Parameter | Description |
---|---|
x | Required. The base |
y | Required. The exponent |
A number representing the value of x to the power of y (xy). |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!