Reference Materials
Certification Courses
Created with over a decade of experience and thousands of feedback.
JavaScript Math Object
In JavaScript, Math is a built-in object that allows you to perform mathematical operations on
the Number type. Math is not a constructor function. It's a property of the implicit global object.
In this reference page, you will find all methods of Math object. You can access methods and constants of the Math object directly. For example, to use the mathematical PI constant, use Math.PI in your code.
Returns the sine of an angle
Returns the cosine of an angle
Returns the tangent of an angle
Returns the absolute value of a number
Returns a number raised to a certain power
Returns the arcsine of a number in radians
Returns the arccosine of a number in radians
Returns the arctangent of a number in radians
Rounds a number up to the next largest integer
Rounds down a number to the next smallest integer
Returns the number rounded to the nearest integer
Returns the integer part of a number
Returns the number with the highest value
Returns the number with the lowest value
Returns the square root of a specified number
Returns the sign of a number
Returns the natural logarithm of a number
Returns the base 2 logarithm of a number
Returns the base 10 logarithm of a number
Returns the natural logarithm of 1 plus number
Returns e (Euler's number) raised to given power
Returns e raised to given power minus 1
Returns the hyperbolic sine of a number
Returns the hyperbolic cosine of a number
Returns the hyperbolic tangent of a number
Returns the hyperbolic arcsine of a number
Returns the hyperbolic arc-cosine of a number
Returns the hyperbolic arctangent of a number
Returns arctangent of the quotient of arguments
Returns the 32-bit float representation of number
Returns sqrt of the sum of squares of arguments
Returns the cube root of a specified number
Returns num of leading zeros in binary of a number
Returns pseudo-random float number between 0 and 1