--- title: Math.E slug: Web/JavaScript/Reference/Global_Objects/Math/E tags: - JavaScript - Math - Property - Referencia translation_of: Web/JavaScript/Reference/Global_Objects/Math/E original_slug: Web/JavaScript/Referencia/Objetos_globales/Math/E ---
La propiedad Math.E representa la base de los logaritmos naturales, e, aproximadamente 2.718.
{{EmbedInteractiveExample("pages/js/math-e.html")}}
Porque E es una propiedad estática de Math, siempre usted lo usa como Math.E, en lugar de como una propiedad de un objeto Math creado (Math no es un constructor).
Math.ELa función siguiente devuelve e:
function getNapier() {
return Math.E
}
getNapier(); // 2.718281828459045
| Especificación | Estado | Comentario |
|---|---|---|
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implementado en JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.8.1.1', 'Math.E')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-math.e', 'Math.E')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-math.e', 'Math.E')}} | {{Spec2('ESDraft')}} |
{{Compat("javascript.builtins.Math.E")}}