1. Math.min(value0, value1, ... , valueN)
The Math.min( ) method is used to find the lowest value in a list of arguments. Have a look at the example below:
2. Math.max(value0, value1, /* ... ,*/ valueN)
The Math.max( ) method is used to find the highest value in a list of arguments. Have a look at the example below:
3. Math.round(a number value)
The Math.round(x) method returns the value of a number x rounded to its nearest integer:
4. Math.sqrt(a number value)
The Math.sqrt(x) is used to return the square root of a number x. If the value of x is negative, Math.sqrt() returns NaN. Have a look at the example below:
5. Math.pow(base, exponent)
The Math.pow(x, y) returns the value of x to the power of y. If the base is negative and the exponent is not an integer, the result is NaN. Let’s have a look at the below example:
6. Math.floor(a number value)
The Math.floor(x) returns the value of x rounded down to its nearest integer. Math.floor(null) returns 0, not a NaN.
7. Math.random( )
The Math.random() returns a random number between 0 and 1. It’s often used to extract random elements from an array.
8. Math.ceil(a number value)
The Math.ceil(x) returns the value of x rounded up to its nearest integer:
Top comments (2)
Is pow still relevant since the aproval of ** operator?
Both works exactly the same. The only difference exponentiation operator doesn't work on older browser where pow() works in older browser. And you also need node version 7 or upper for exponentiation operator to work.