pow

Returns base to the exponent power, that is, baseexponent.

Applies to

Math

Syntax

pow(x,y)

Parameters

base

The base number.

exponent

The exponent to which to raise base.

Description

pow is a static method of Math. As a result, you always use it as Math.pow(), rather than as a method of a Math object you create.

Examples

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).

See also

Math.exp, Math.log