Math.pow()

ES1+

Returns the base to the exponent power.

Syntax

Math.pow(base, exponent)

Parameters

base number

The base number

exponent number

The exponent used to raise the base

Return Value

number

A number representing the given base taken to the power of the given exponent

Examples

JavaScript
console.log(Math.pow(2, 3));
console.log(Math.pow(4, 0.5));
console.log(2 ** 3); // 대안
Output:
// 8 2 8

Related Methods