This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

max

Summary

Returns the larger of a set of supplied numeric expressions.

Syntax

Math.max([ number1 [, number2 [... [, numberN ]]]])

Examples

The following code shows how to get the larger of two expressions.

var x = Math.max(107 - 3,  48 * 90);
 document.write(x);

 // Output:
 // 4320

Remarks

The optional number1, number2, …, numberN arguments are numeric expressions to be evaluated.

If no arguments are provided, the return value is equal to Number.NEGATIVE_INFINITY. If any argument is NaN , the return value is also NaN.

See also

Other articles

Attributions