Math.max() (Function)

The maximum of the two or more input arguments is returned.

Availability:

ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server version - 2.0
Opera - 3.0
Property/method value type:Number primitive
JavaScript syntax:-Math.max(aValue1, aValue2, ...)
Argument list:aValue1Some meaningful numeric value
aValue2Some meaningful numeric value

Returns the larger of the two or more arguments.

Special boundary conditions that affect the results are:

Argument1Argument2Result
Any valueNaNNaN
Any valueThe same valueThe value
largersmallerArgument1
NaNAny valueNaN
smallerlargerArgument2

See also:Math object

Cross-references:

ECMA 262 edition 2 - section - 15.8.2.11

ECMA 262 edition 3 - section - 15.8.2.11