Math.E
A propriedade Math.E
representa a base dos logarítmos naturais, aproximadamente 2.718.
Experimente
Property attributes of Math.E |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Descrição
Como E
é uma propriedade estática de Math
, sempre use-a como Math.E
, ao invés de uma propriedade de um objeto Math
que você criou (Math
não é um construtor).
Exemplos
Usando Math.E
A seguinte função retorna o valor de e:
function getNapier() {
return Math.E;
}
getNapier(); // 2.718281828459045
Especificações
Especificação | Status | Comentário |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Padrão | Definição inicial. Implementado no JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'Math.E' in that specification. |
Padrão | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Math.E' in that specification. |
Padrão | |
ECMAScript (ECMA-262) The definition of 'Math.E' in that specification. |
Padrão em tempo real |
Compatibilidade com navegadores
BCD tables only load in the browser