JavaScript pow() Method
Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
JavaScript pow() Method
❮ JavaScript Math Object
Example
Return the value of the number 4 to the power of 3 (4*4*4):
Math.pow(4, 3);
<!--
The result will be:
64
-->Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The pow() method returns the value of x to the power of y (xy).
Browser Support
Method | |||||
---|---|---|---|---|---|
pow() | Yes | Yes | Yes | Yes | Yes |
Syntax
Math.pow(x, y)
Parameter Values
Parameter | Description |
---|---|
x | Required. The base |
y | Required. The exponent |
<!--
mid_content, all: [300,250][336,280][728,90][970,250][970,90][320,50][468,60]-->
Technical Details
Return Value: | A Number, representing the value of x to the power of y (xy) |
---|---|
JavaScript Version: | ECMAScript 1 |
More Examples
Example
Use the pow() method on different numbers:
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);
<!--
The result of a,b,c,d,e, and f will be:
0
1
1
27
-27
16
-->Try it Yourself »
❮ JavaScript Math Object