JavaScript pow()Method
Definition and Usage
The pow() method returns the value of x to the power of y.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the pow() method
Syntax
Math.pow(x,y)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. The base. Must be a number. |
| y | Required. The exponent. Must be a number. |
Return Value
| Type | Description |
|---|---|
| Number | x to the power of y. |
Technical Details
| JavaScript Version: | 1.0 |
|---|
More Examples
Example
In the following example, we will apply pow() to different number combinations:
var a=Math.pow(0,1);
var b=Math.pow(1,1);
var c=Math.pow(1,10);
var d=Math.pow(3,3);
var e=Math.pow(-3,3);
var f=Math.pow(2,4);
var b=Math.pow(1,1);
var c=Math.pow(1,10);
var d=Math.pow(3,3);
var e=Math.pow(-3,3);
var f=Math.pow(2,4);
a,b,c,d,e, and f output result:
0
1
1
27
-27
16
1
1
27
-27
16
Try it Yourself »
Other Extensions
JavaScript Math Object