Math.min()

Math.min(a, b, …)

Returns the smallest of the passed numbers. An array is passed with spread: Math.min(...array).

Parameters

  • a, b, … – numbers.

Return value

The smallest number; Infinity without arguments.

Examples

const temperatures = [3, -2, 5, -1];
console.log(Math.min(...temperatures), Math.min());
const inStock = 3;
console.log('Can be added to the cart:', Math.min(10, inStock));

Output:

-2 Infinity
Can be added to the cart: 3

Things to watch out for

  • Without arguments it returns Infinity (the opposite of Math.max()).
  • A string in the array is converted to a number, null to 0 – unexpected zeros in the data then win.

Browser support

Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 1, Firefox 1, Safari 1; Node.js 0.10.0. As of October 2026 (MDN browser-compat-data).

Related:
Math.max()
Spread syntax (...)