JS Built-ins
← Math162 / 215
Mathminbeginner

Math.min() β€” All Negatives

πŸ“– 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: Use Math.min(-1, -5, -2) to find the minimum among negative numbers.

πŸ’‘ Hints (1)
  • β€’ -5 is the smallest (furthest from zero) among -1, -5, -2