Math

Math.E

Represents Euler's number, the base of natural logarithms, approximately 2.718

Syntax

JavaScript
Math.E

Return Value

The number 2.718281828459045

Examples

Basic Usage
console.log(Math.E); // 2.718281828459045
Practical Example
function compoundInterest(principal: number, rate: number, time: number) {
  return principal * Math.E ** (rate * time);
}
console.log(compoundInterest(1000, 0.05, 10).toFixed(2)); // '1648.72'
Advanced Usage
console.log(Math.log(Math.E)); // 1
console.log(Math.pow(Math.E, 2)); // ~7.389

Understanding Math.E

The Math.E method in JavaScript represents Euler's number, the base of natural logarithms, approximately 2.718. It belongs to the Math object and is one of the most widely used methods for working with math values in modern JavaScript and TypeScript applications.

The method signature is Math.E. When called, it returns the number 2.718281828459045. Understanding when and how to use E() helps you write more expressive, readable code.

Common use cases for Math.E include data transformation, input validation, API response processing, and building reusable utility functions. It works well alongside related methods like math-pi, math-log, enabling you to chain operations together for complex data manipulation pipelines.

Browser support for Math.E is excellent across all modern browsers including Chrome, Firefox, Safari, and Edge. It is also fully supported in Node.js and Deno. For older environments, transpilation with Babel or a polyfill may be needed.

Browser Compatibility

Supported in all modern browsers (Chrome, Firefox, Safari, Edge) and Node.js. Part of the ECMAScript standard.

Related Methods

More Math Methods

Other methods in the Math object

Related Tools

More Math Methods

Explore JavaScript Methods

Browse our complete reference of 410 JavaScript methods with syntax, examples, and explanations.