# Math Object in JavaScript

## Math Object in JavaScript

In our previous tutorial, we created a simple calculator using JavaScript. In this tutorial, you will learn advanced Math functions to perform scientific operations of the calculator using JavaScript. To perform mathematical tasks on web pages, we use JavaScript Math object. This object allows us to perform different mathematical work and calculation by using just one simple function.

### Math Functions

In JavaScript there are sevral mathematical function some are given below:

• Random()
• Max()
• Min()
• Floor()
• Round()
• Abs()
• Log()
• Cos()
• Sin()
• Tan()
• Sqrt()

### Math.random()

This function returns 1 or 0 randomly.

### Math.Max()

This function returns maximum value from its given parameters.

### Math.Min()

This function returns minimum value from its given parameters.

### Math.floor()

This function rounds a number down to the nearest integer.

### Math.Round()

This function rounds a number to the nearest integer.

### Math.ceil()

This function rounds a number up to the nearest integer.

### Math.Abs()

This function returns the absolute value of given parameter.

### Math.log()

This function returns the log of the given parameter.

### Math.tan()

This function returns the tangent of the given parameter.

### Math.sin()

This function returns the sin of the given parameter.

### Math.cos()

This function returns the cos of the given parameter.

### Math.sqrt()

This function returns the square of the given parameter.