Exponential Function in JavaScript

Level 125 keystrokes

Math.exp(1) returns e raised to the power of 1, so it prints Euler's number 2.718281828459045.

JavaScript code

// Math.exp(x) returns e ** x, where e ≈ 2.718 is the base of natural logarithms
// With x = 1 the result is e itself, the same value as Math.E
1console.log(Math.exp(1));

Output

2.718281828459045
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this JavaScript code and how often they appear.

  • .× 2
  • (× 2
  • )× 2
  • ;× 1

More JavaScript examples at level 1

← JavaScript typing practice