Math E Property - Javascript Math

Javascript examples for Math:E

Description

The E property returns the Euler's number and the base of natural logarithms, approximately 2.718.

Return Value:

A Number, representing Euler's number

The following code shows how to return the Euler's number:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials