JavaScript Tutorial JavaScript References

JavaScript - Math.E Property



The JavaScript Math.E property is the Euler's constant and the base of natural logarithms. It is approximately 2.718.

Syntax

Math.E

Example:

The example below shows the usage of Math.E property.

var txt;

txt = "Math.E = " + Math.E + "<br>";
txt = txt + "Math.log(Math.E) = " + Math.log(Math.E) + "<br>";
txt = txt + "Math.log1p(Math.E - 1) = " + Math.log1p(Math.E - 1) + "<br>";

The output (value of txt) after running above script will be:

Math.E = 2.718281828459045
Math.log(Math.E) = 1
Math.log1p(Math.E - 1) = 1

❮ JavaScript - Math Object