JavaScript Math.pow()
Description
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 (JavaScriopt 1997) feature.
It is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
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). |