JavaScript (ES2026) reference · Math Methods and Constants

JavaScript Math.exp() Method

Return e (about 2.718) raised to the given power, used for exponential growth, decay and probability formulas.

JavaScript (ES2026) Since ES1

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

Math.exp(x)

Parameters

ParameterDescription
x A number.

Return value

A number.

Examples

e to a powerTry it yourself
console.log(Math.exp(0), Math.exp(1) === Math.E);

Output

1 true
Exponential decayTry it yourself
const decay = (n0, k, t) => n0 * Math.exp(-k * t);
console.log(decay(100, 0.1, 10).toFixed(2));

Output

36.79

Version history

VersionChange
JavaScript ES1Added

Was this page helpful?