Math.E
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itโs been available across browsers since โจ2015๋ 7์โฉ.
Math.E
์ ์ ๋ฐ์ดํฐ ์์ฑ์ ์ค์ผ๋ฌ ์๋ฅผ ์๋ฏธํ๋ฉฐ, ์์ฐ๋ก๊ทธ์ ๋ฐ ๊ฐ e๋ฅผ ๋ํ๋ด๋ฉฐ ์ฝ 2.718์ ๊ฐ์ ๊ฐ์ง๋๋ค.
์๋ํด ๋ณด๊ธฐ
function compoundOneYear(interestRate, currentVal) {
return currentVal * Math.E ** interestRate;
}
console.log(Math.E);
// Expected output: 2.718281828459045
console.log((1 + 1 / 1000000) ** 1000000);
// Expected output: 2.718280469 (approximately)
console.log(compoundOneYear(0.05, 100));
// Expected output: 105.12710963760242
๊ฐ
Property attributes of Math.E | |
---|---|
์ฐ๊ธฐ ๊ฐ๋ฅ | ๋ถ๊ฐ๋ฅ |
์ด๊ฑฐ ๊ฐ๋ฅ | ๋ถ๊ฐ๋ฅ |
์ค์ ๊ฐ๋ฅ | ๋ถ๊ฐ๋ฅ |
์ค๋ช
E
๋ Math
์ ์ ์ ์์ฑ์ด๋ฏ๋ก, ์์ฑํ Math
๊ฐ์ฒด(Math
๋ ์์ฑ์๊ฐ ์๋๋๋ค)์ ์์ฑ ๋์ ํญ์ Math.E
๋ฅผ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
์์
Math.E
์ฌ์ฉํ๊ธฐ
๋ค์ ํจ์๋ e ๊ฐ์ ๋ฐํํฉ๋๋ค.
js
function getNapier() {
return Math.E;
}
getNapier(); // 2.718281828459045
๋ช ์ธ์
Specification |
---|
ECMAScriptยฎ 2026 Language Specification # sec-math.e |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ