W3cubDocs

/JavaScript

Math.E

The Math.E property represents the base of natural logarithms, e, approximately 2.718.

Math.E=e2.718\mathtt{\mi{Math.E}} = e \approx 2.718

Property attributes of Math.E
Writable no
Enumerable no
Configurable no

Description

Because E is a static property of Math, you always use it as Math.E, rather than as a property of a Math object you created (Math is not a constructor).

Examples

Using Math.E

The following function returns e:

function getNapier() {
  return Math.E;
}

getNapier(); // 2.718281828459045

Specifications

Browser compatibility

Feature Chrome Edge Firefox Internet Explorer Opera Safari
Basic support Yes Yes Yes Yes Yes Yes
Feature Android webview Chrome for Android Edge mobile Firefox for Android Opera Android iOS Safari Samsung Internet
Basic support Yes Yes Yes Yes Yes Yes ?

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/E