Math functions in JavaScript

Today we’ll show you the list of JavaScript Math functions that every web developer should know.

Math is a built-in object that has properties and methods for mathematical constants and functions. It’s not a function object.

List of JavaScript Math functions

  1. Math.min()
  2. Math.max()
  3. Math.random()
  4. Math.round()
  5. Math.ceil()
  6. Math.pow()
  7. Math.floor()
  8. Math.abs()

1. Math.min()

The Math.min() function returns the number with the lowest value.

2. Math.max()

The Math.max() function returns the number with the largest value.

3. Math.random()

The Math.random() function returns the random number between 0 to 1.

4. Math.round()

The Math.round() function returns the rounds number to its nearest integer.

5. Math.ceil()

The Math.ceil() function rounds a number up to the next largest integer.

6. Math.pow()

The Math.pow() function returns the base to the exponent power.

7. Math.floor()

The Math.floor() function rounds a number down to its nearest integer.

8. Math.abs()

The Math.abs() function returns the absolute value of a number.

I hope you find this article helpful.
Thank you for reading. Happy Coding..!! 🙂

If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *