Standard built-ins
Math.max()
Returns the greatest converted Number; no arguments yields -Infinity. NaN propagates, and +0 wins a zero tie.
Formal Syntax & Structure
javascript syntaxjavascript
Math.max(...values)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| values | number[] | Individual numeric arguments (coerced to Number). |
Return Value
number
Calculated Number.
Working Example
Example Snippetjavascript
console.log(Math.max(5,2),Math.max());