Javascript Math object also provides some properties along with Math functions. Javascript Math object properties return the constant values for Math constants such as Pi or Euler’s constant. Math object properties return pre calculated values also e.g.: natural Log value of 2 or 10. Following are the Javascript Math object properties:

Math.E: returns the value of Euler’s constant. (2.718281828459045)

Math.LN10: returns the natural log of 10. (2.302585092994046)

Math.LN2: returns the natural log of 2. (0.6931471805599453)

Math.LOG10E: returns the base-10 log of E. (0.4342944819032518)

Math.LOG2E: returns the base-2 log of E. (1.4426950408889633)

Math.PI: returns the constant value of PI. (22/7 = 3.141592653589793)

Math.SQRT1_2: returns the value of square root of ½. (0.7071067811865476)

Math.SQRT2: returns the square root of 2. (1.4142135623730951)

Above Javascript Math properties return the predefined values for the constants like Pi and E. Other properties like LOG10E, LN10, SQRT2 provides the pre calculated values that reduces the code length by eliminating the logical code for deriving the values each time when they are required. You can directly use these Javascript Math object properties.

Continue to next tutorial: Javascript Math Round Function to learn how to round off the values to their nearest number.

Recent JavaScript Tutorials

Javascript FSO ShortPath property

Javascript FileSystemObject (FSO) provides a ShortPath property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Path Property

Javascript FileSystemObject (FSO) provides the Path property that can be accessed through the file object or folder object returned by the GetFile or GelFolder method

Javascript FSO Type property

Javascript FileSystemObject (FSO) provides a Type property that can be accessed through file object or folder object returned by the GetFile or GetFolder method

Javascript FSO ShortName property

Javascript FileSystemObject (FSO) provides a ShortName property that can be accessed using the folder object or file object returned by the GetFolder or GetFile method.

Javascript FSO Name Property

Javascript FileSystemObject (FSO) provides a Name property that can be accessed using file object or folder object.