To make mathematical calculation easier on numbers, javascript provides Math object. Its all properties and methods are static means it can be directly used without creating its object.

Math only works with numbers not with BigInt data type.

Math object Properties

Math PropertiesDescriptionApproximate values
Math.EGives Euler’s number2.718
Math.LN10Gives Natural logarithm of 102.303
Math.LN2Gives Natural logarithm of 20.693
Math.PI3.14159
Math.LOG10EGives Base-10 logarithm of E0.434
Math.LOG2EGives Base-2 logarithm of E1.443

Math Static methods

Math methodsUse
Math.sqrt()Gives Square root
Math.round()Gives rounded value
Math.random()Gives random number between 0 to 1.
Math.pow()Gives power of given number raises to the second number
Math.ceil()
Math.abs()Gives Absolute number