How to get Euler's constant value in JavaScript?

To get Euler’s constant value in JavaScript, use the Math E property. This is a Euler's constant and the base of natural logarithms, approximately 2.718.


You can try to run the following code to get Euler’s constant value in JavaScript −

Live Demo

      <title>JavaScript Math E Property</title>
         var property_value = Math.E
         document.write("Property Value is :" + property_value);


Property Value is :2.718281828459045