JS Math
The JavaScript Math object allows you to perform mathematical tasks on numbers.
The JavaScript Math object allows you to perform mathematical tasks on numbers.
The Math Object
Unlike other objects, the Math object has no constructor. The Math object is static. All methods and properties can be used without creating a Math object first.
Preview
Math.round()
Math.round(x) returns the nearest integer.
Preview
Math.pow()
Math.pow(x, y) returns the value of x to the power of y.
Preview
Math.sqrt()
Math.sqrt(x) returns the square root of x.
Preview
Math.min() and Math.max()
Math.min() and Math.max() can be used to find the lowest or highest value in a list of arguments.
Preview