Applies to: Math Object
The pow method is use to get the value of a base expression taken to a specified power.
Syntax
Math.pow(base, exponent)
The pow method syntax has these parts:
Part |
Description |
base |
The base value of the expression. |
exponent |
The exponent value of the expression. |
Return value
Returns the value of a base expression taken to a specified power.
Example
In the following example, a numeric expression equal to baseexponent returns 1000.
document.write(Math.pow(10,3));
|
To run the code above, paste it into JavaScript Editor, and click the Execute button
See also: Math Object Methods |