JavaScript Math.min() Method
The Math.min() static method returns the smallest of the numbers passed to it.
Description
The Math.min() static method returns the smallest of its arguments. Spread an array into it to find the array's minimum. With no arguments it returns Infinity.
Like Math.max(), it returns NaN if any argument isn't a number, and arrays must be spread rather than passed directly. For finding the object with the smallest value of a property, such as the cheapest product, use reduce(), or sort a copy of the array.
Combined with Math.max(), it's commonly used to clamp a value into a range, for example keeping a slider position between 0 and 100: Math.min(Math.max(value, 0), 100). Like every member of Math, it's called on the Math object itself rather than on a number, and it only works with the Number type: passing a BigInt throws a TypeError.
Syntax
Math.min(value1, value2, ...)Parameters
- value1, value2, ...Numbers to compare.
Return Value
The smallest number, Infinity with no arguments, or NaN if any argument can't be converted.
Example
Browser Support
The following information will show you the current browser support for the Math.min() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





