Tuesday, December 31, 2024
Google search engine
HomeLanguagesJavascriptJavaScript Math E Property

JavaScript Math E Property

The Math.E is a property in JavaScript that simply returns the value of Euler’s Number, which is nothing but just has a base of the natural logarithm. Its value is approximately around of 2.71828.

Syntax:

Math.E;
Math.E ≈ 2.718

Return Values: It simply returns the value of the base of the natural logarithm.

Example 1: Below is an example of the Math E Property.

Javascript




console.log(Math.E)


Output

2.718281828459045

Example 2: The value of the base of the natural logarithm can be printed in the form of a function as shown below.

Javascript




// function is being called.
function value() {
    return Math.E;
}
 
// Calling Function.
console.log(value());


Output

2.718281828459045

Example 3: We consider Math.E is a function but in actuality, it is a property which is why the error as output is being shown.

Javascript




console.log(Math.E(70));


Output:

Error: Math.LN2 is not a function

Note: Check the console for errors.

Related Articles: Javascript Math Object Complete reference 

Supported Browsers:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Firefox 1 and above
  • Opera 3 and above
  • Safari 1 and above
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments