Skip to content

max ​

The max() method returns the largest value among the provided numbers. It lets you compare several values and obtain the maximum.

Interactive example ​

Syntax ​

typescript
function max<
	GenericInput extends AnyTuple<number>
>(
	input: GenericInput
): number

Parameters ​

  • input: Tuple of numbers to compare.

Return value ​

The largest number in the provided tuple.

See also ​

  • min - Returns the minimum value
  • clamp - Clamps a number within a range

Sources ​

Released under the MIT license.