JS Built-ins
← Math163 / 215
Mathminintermediate

Math.min() β€” No Arguments

πŸ“– Usage Example
// Smallest of the given numbers
Math.min(1, 5, 3)   // β†’ 1
Math.min(-1, -5)    // β†’ -5

Use Math.min() to find the smallest value among a set of numbers, or to clamp a maximum bound.

Math.min()

Returns the smallest of the given numbers.

Challenge: Observe that Math.min() with no arguments returns Infinity.

πŸ’‘ Hints (1)
  • β€’ The identity element for min is Infinity (every number is ≀ Infinity)