Javatpoint Logo
Javatpoint Logo

JavaScript Math pow() method

The JavaScript math pow() method returns the base to the exponent power such as baseexponent. In other words, the base value (x) is multiplied with itself exponent times (y).

Syntax

The pow() method is represented by the following syntax:

Parameter

Base - The base number.

Exponent - The number used to raise the base.

Return

The value of base to the power of exponent.

JavaScript Math pow() method example

Here, we will understand pow() method through various examples.

Example 1

Let's see a simple example to print the power of given number.

Test it Now

Output:

8
9.518269693579391

Example 2

Let's see an example to understand the pow() method with different test cases.

Test it Now

Output:

0.125
9
NaN
0.1050611121761507

Example 3

Let's understand the pow() method with your own test cases.

Test it Now
Next TopicJavaScript Math




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA