This content originally appeared on DEV Community and was authored by Pritom Deb
1. Math.min( )
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( )
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( )
The Math.round(x) method returns the value of a number x rounded to its nearest integer:

4. Math.sqrt( )
The Math.sqrt(x) is used to return the square root of a number x. Have a look at the example below:

5. Math.pow( )
The Math.pow(x, y) returns the value of x to the power of y. Let’s have a look at the below example:
![]()
6. Math.floor( )
The Math.floor(x) returns the value of x rounded down to its nearest integer:

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( )
The Math.ceil(x) returns the value of x rounded up to its nearest integer:
![]()
This content originally appeared on DEV Community and was authored by Pritom Deb
Pritom Deb | Sciencx (2021-12-22T20:11:27+00:00) Important Math methods. Retrieved from https://www.scien.cx/2021/12/22/important-math-methods/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.