Math.E

Math.E 静态数据属性表示欧拉数,即自然对数 e 的底数,大约为 2.718。

¥The Math.E static data property represents Euler's number, the base of natural logarithms, e, which is approximately 2.718.

Try it

¥Value

𝙼𝚊𝚝𝚑.𝙴 = e 2.718 \mathtt{Math.E} = e \approx 2.718

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

描述

¥Description

因为 EMath 的静态属性,所以你始终将其用作 Math.E,而不是用作你创建的 Math 对象的属性(Math 不是构造函数)。

¥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

使用 Math.E

¥Using Math.E

以下函数返回 e:

¥The following function returns e:

js
function getNapier() {
  return Math.E;
}

getNapier(); // 2.718281828459045

规范

Specification
ECMAScript Language Specification
# sec-math.e

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看