Learn JavaScript
Math Object

Finding the Largest Number

Let’s take a look at the code given below. It helps us find the largest number from a group of numbers.

Some mathematical calculations are extremely useful in many circumstances. For example, finding the largest number from a group of numbers, etc.

To avoid repeating the same code, it makes sense that we have a standard set of functions that we can use in these situations.

In JavaScript, this role is performed by the Math object. It contains mathematical methods and constants which are extremely useful in our work, like the Math.max() method.