The mathMin() function returns the lowest-valued number passed into it, or NaN if any parameter isn't a number and can't be converted into one.

If no arguments are given, the result is Infinity.

If at least one of arguments cannot be converted to a number, the result is NaN.

0.4.2

const x = 10, y = -20;
const z = Math.min(x, y); // -20
  • Parameters

    • Rest...values: number[]

      Zero or more numbers among which the lowest value will be selected and returned.

    Returns number

    The smallest of the given numbers. If any one or more of the parameters cannot be converted into a number, NaN is returned. The result is Infinity if no parameters are provided.