Home >>JavaScript Math Reference >JavaScript pow() Method
The Math pow() Method in JavaScript is used to returns the base to the exponent power means power of a number. In other words, the base value m raised to the nth power. Generally, it is always used as Math.pow() because the pow() method in Math object is static function.
Syntax:Math.pow (base, exponent)
Parameter | Description |
---|---|
x | It Required the base |
y | It Required the exponent |
Method | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
pow() | Yes | Yes | Yes | Yes | Yes |
<html> <body> <p>It multiplies the number five times like 6*6*6*6*6</p> <button onclick="myPow()">click me</button> <p id="pow"></p> <script> function myPow() { document.getElementById("pow").innerHTML = Math.pow(6, 5); } </script> </body> </html>
It multiplies the number five times like 6*6*6*6*6
<html> <body> <script> document.write(Math.pow(-5, 0.3)); </script> </body> </html>