Return the number with the highest value:
The result will be:
The max() method returns the number with the highest value.
![]()
The max() method is supported in all major browsers.
| Parameter | Description |
|---|---|
| n1,n2,n3,...,nX | Optional. One or more numbers to compare |
| Type | Description |
|---|---|
| Number | The highest number of the arguments, or -Infinity if no arguments are given, or NaN if one or more arguments are not numbers |
| JavaScript Version: | 1.0 |
|---|
Return the number with the highest value:
The result of a,b,c,d, and e will be:
JavaScript Math Object
Your message has been sent to W3Schools.