Skip to content

min

The min() method returns the smallest value among the provided numbers. It lets you compare several values and obtain the minimum.

Interactive example

Syntax

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

Parameters

  • input: Tuple of numbers to compare.

Return value

The smallest number in the provided tuple.

See also

  • max - Returns the maximum value
  • clamp - Clamps a number within a range

Sources

Released under the MIT license.