min (JavaScript)

Gets the lesser of two numbers.

Defined in

Math (JavaScript)

Syntax

min(v1:double, v2:double) : double
Parameter Description
v1 A number.
v2 A number.
Return value Description
double The value of the lesser number, or the value of either if they are equal.

Examples

This onblur event is for a field bound to sessionScope.n and forces it to have a maximum value of sessionScope.min.
sessionScope.n = Math.min(sessionScope.n, sessionScope.min)