max()

Returns the largest number among the given arguments.

Syntax

max(value1, [value2, ...])

Parameters

Parameter Type Description
value1 Number The first value to compare.
value2..N Number Additional values to compare. optional

Return Value

Examples

max(4); // returns 4
max(7, 3, 9, -1); // returns 9

See also

min
max