Home >>JavaScript Math Reference >JavaScript exp() Method
The JavaScript math exp() method return ex. Here, x is the argument, and e is the Euler’s constant. e is the base of natural algorithm. It is always used at Math.exp() because it is static method of math.
Syntax:Math.exp(x)
Parameter | Description |
---|---|
X | It Required a Number. |
Method | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
exp() | Yes | Yes | Yes | Yes | Yes |
<html> <body> <button onclick="myexp()">Click me</button> <p id="exp"></p> <script> function myexp() { document.getElementById("exp").innerHTML = Math.exp(1); } </script> </body> </html>
<html> <body> <script> document.writeln(Math.exp(1)+"<br>"); document.writeln(Math.exp(3)+"<br>"); document.writeln(Math.exp(-3)); </script> </body> </html>