Math.pow()

Summary

The Math.pow() function returns the base to the exponent Power,  that is, baseexponent.

Syntax

Math.pow(base, exponent) 

Parameters

base
The base number.
exponent
The exponent used to raise the base.

Description

Because pow is a static method of Math, you always use it as Math.pow(), instead as a method of a Math Object you created.

Example

Example: Using Math.pow

function raisePower(x,y) {
   return Math.pow(x,y)
}

If x is 7 and y is 2, raisePower returns 49 (7 to the power of 2).

Specifications

Specification Status Comment
ECMAScript 1st Edition. Implemented in JavaScript 1.0 Standard Initial definition.
ECMAScript Language Specification 5.1th Edition (ECMA-262) Standard  
ECMAScript Language Specification 6th Edition (ECMA-262) Draft  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)

See also

Document Tags and Contributors

Contributors to this page: evilpie, Sheppy, Marcoos, fscholz, ethertank, egiw, Mgjbot, Maian, Dria, Kyodev
Last updated by: fscholz,