JavaScript Math.max()
JavaScript Math.max()
The Math.max() method is used to return the number with the highest value. Its opposite function is Math.min() which returns the minimum value among all values.
Syntax:-
Its syntax is:- Math.max(n1, ..., nX)
Return:-
Its return is:- number with the highest value among arguments
Further Explanation:-
Parameter | Description |
---|---|
n1, ..., nX | Optional. One or more numbers to compare |