Math.constant Math.function()
compute an absolute value
compute an arc cosine
compute an arc sine
compute an arc tangent
compute the angle from the X axis to a point
round a number up
compute a cosine
compute an exponent of e
round a number down
compute a natural logarithm
return the larger of two numbers
return the smaller of two numbers
compute xy
compute a random number; not available on all platforms
round to the nearest integer
compute a sine
compute a square root
compute a tangent
Math is a read-only reference to a placeholder object that contains mathematical functions and constants. These functions and constants are conveniently grouped by this Math object, and are invoked with syntax like this:
y =index.html Math.sin(x); area = radius * radius * Math.PI;
Math is actually a "global" property of the Window object, and as such, is usually referred to as Math, rather than as window.Math.
Math is not a class of objects like Date and String are. The Date class, for example, defines methods that operate on Date objects; on instances of the class. Math, on the other hand is simply an object that contains references to functions. These functions happen to be invoked through the Math object, but they do not operate on that object, as methods would.