JS Built-ins
← Math156 / 215
Mathmaxbeginner

Math.max() β€” Basic Maximum

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

Use Math.max() to find the largest value among a set of numbers, or to clamp a minimum bound.

Math.max()

Returns the largest of the given numbers.

Challenge: Use Math.max(1, 2, 3) to find the largest value.

πŸ’‘ Hints (1)
  • β€’ Math.max returns the largest of all provided arguments