Math.E

  • Revision slug: JavaScript/Reference/Global_Objects/Math/E
  • Revision title: E
  • Revision id: 88214
  • Created:
  • Creator: OsamaBinLogin
  • Is current revision? No
  • Comment Reverted to earlier version; 17 words added, 6 words removed

Revision Content

 

Summary

The base of natural logarithms, e, approximately 2.718.

Property of Math

Static, Read-only

Implemented in: JavaScript 1.0, NES 2.0
ECMA Version: ECMA-262

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.

Examples

Example: Using Math.E

The following function returns e:

function getNapier() {
   return Math.E
}

{{ languages( { "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Math/E", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Math/E", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Math/E" } ) }}

Revision Source

<p> </p>
<h3 name="Summary">Summary</h3>
<p>The base of natural logarithms, e, approximately 2.718.</p>
<table class="fullwidth-table"> <tbody> <tr> <td class="header" colspan="2">Property of <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Math" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Math">Math</a></td> </tr> <tr> <td colspan="2"> <p><strong>Static, Read-only</strong></p> </td> </tr> <tr> <td>Implemented in:</td> <td>JavaScript 1.0, NES 2.0</td> </tr> <tr> <td>ECMA Version:</td> <td>ECMA-262</td> </tr> </tbody>
</table>
<h3 name="Description">Description</h3>
<p>Because <code>E</code> is a static property of <code>Math</code>, you always use it as <code>Math.E</code>, rather than as a property of a <code>Math</code> object you created.</p>
<h3 name="Examples">Examples</h3>
<h4 name="Example:_Using_Math.E">Example: Using <code>Math.E</code></h4>
<p>The following function returns e:</p>
<pre>function getNapier() {
   return Math.E
}
</pre> <p>{{ languages( { "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Math/E", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Math/E", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Math/E" } ) }}</p>
Revert to this revision