Javascript - Math exp() Method

The exp(x) method returns the value of E^x, where E is Euler's number (approximately 2.7183).

Description

The exp(x) method returns the value of E^x, where E is Euler's number (approximately 2.7183).

Syntax

Math.exp(x)

Parameter Values

Parameter Require Description
x Required. A number

Return

A Number, representing E^x

Example

Return Ex, where x is 1

Demo

//display the result of Math.exp(1).
console.log(Math.exp(1));

Result

Use the exp() method on different numbers:

Demo

//display the result of Math.exp() on different numbers.
var a = Math.exp(-1);
var b = Math.exp(5);
var c = Math.exp(10);

var x = a + "\n" + b + "\n" + c;
console.log(x);//from   www  .  j  av a2 s  .  c o  m

Result