Javascript examples for Math:E
The E property returns the Euler's number and the base of natural logarithms, approximately 2.718.
A Number, representing Euler's number
The following code shows how to return the Euler's number:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// ww w . j a v a 2s . c om var a = Math.E; var x = a ; document.getElementById("demo").innerHTML = x; } </script> </body> </html>