JavaScript EXP

The JavaScript EXP function a Math function used to calculate the power of E, Where E is Euler’s number approximately equal to 2.71828. The syntax of the math EXP Function is


If the number argument is not a number, JavaScript EXP function will return NaN. If it is Null, the EXP function converts the Null value to Zero.

JavaScript EXP Function Example

In this JavaScript EXP Function example, We are going to check the same with different data types and display the output

<!DOCTYPE html>
    <title> JavaScript EXP Function </title>
  <h1> JavaScript EXP Function </h1>
  <p id = "Pos"></p>
  <p id = "Neg"></p>
  <p id = "Dec"></p>
  <p id = "Neg_Dec"></p>
  <p id = "Str"></p>
  <p id = "Exp"></p>
  <p id = "Null"></p>
  <p id = "Multi"></p>
    document.getElementById("Pos").innerHTML = Math.exp(1);
    document.getElementById("Neg").innerHTML = Math.exp(-1);
    document.getElementById("Dec").innerHTML = Math.exp(10.45);
    document.getElementById("Neg_Dec").innerHTML = Math.exp(-6.45);
    document.getElementById("Str").innerHTML = Math.exp("JavaScript");
    document.getElementById("Null").innerHTML = Math.exp(null);
    document.getElementById("Multi").innerHTML = Math.exp(2 + 5 - 5);
JavaScript EXP Function