JavaScript Math.pow()
Definition and Usage
The Math.pow() method returns the value of x to the power of y (xy).
More Examples
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 »
Browser Support
Math.pow()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
Math.pow(x, y)
Parameters
Parameter | Description |
---|---|
x | Required. The base |
y | Required. The exponent |
Return Value
A number representing the value of x to the power of y (xy). |