let a = Math.min(5, 10);
let b = Math.min(0, 150, 30, 20, 38);
let c = Math.min(-5, 10);
let d = Math.min(-5, -10);
let e = Math.min(1.5, 2.5);
Try it Yourself »
The Math.min()
method returns the number with the lowest value.
Math.min(
n1,
n2,...)
Parameter | Description |
n1, n2,... | Optional. One or more numbers to compare. |
Type | Description |
Number | The lowest number of the arguments.-Infinity if no arguments are given.NaN if one of the arguments is not a number. |
Math.min()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!