On this page
  1. Math.min
  2. Signature & Overview
  3. Notes & Pitfalls
  4. Example

Math.min

Prev: floor | Up: Math | Next: random
Rel: Math, JSON, Math, BigInt & Date Guide
Ref: MDN Web Docs — Math.min
Tags: #public #web #javascript #builtins #math #tier/core


Signature & Overview

Math.min(...values)  /* + Math.max(...values) */

Returns the smallest (or largest) of zero or more numbers (Infinity / -Infinity if empty).

Notes & Pitfalls

Example

console.assert(Math.min(5, 2, 9) === 2);
console.assert(Math.min(...[10, -3, 4]) === -3);

Linked from

Related notes