min Function

Top  Previous  Next

Returns the number with the lowest value.

Syntax

Math.min(number1, number2, ...)

Arguments

number1A number.
number2A number.

Return Value

Returns the lowest number of the arguments, or NaN if one or more arguments are not numbers.

Example

Math.min(2,10);       // Returns 2

Math.min(-2,10);      // Returns -2

See also

Math.max