Skip to content

minmax

minmax(values): MinMaxResult

Defined in: packages/core/src/number/minmax.ts:19

Calculates the minimum and maximum values from a list of numbers.

This function iterates through the provided numbers to find the smallest and largest values.

Its equivalent to calling Math.min and Math.max, but does the iteration only once.

readonly number[]

The values to calculate the min and max of, as an array or as separate arguments.

MinMaxResult

An object containing the min and max values, or min = Infinity and max = -Infinity if no values are provided.

minmax(…values): MinMaxResult

Defined in: packages/core/src/number/minmax.ts:20

Calculates the minimum and maximum values from a list of numbers.

This function iterates through the provided numbers to find the smallest and largest values.

Its equivalent to calling Math.min and Math.max, but does the iteration only once.

…number[]

The values to calculate the min and max of, as an array or as separate arguments.

MinMaxResult

An object containing the min and max values, or min = Infinity and max = -Infinity if no values are provided.