min (for BigInts) es-toolkit
Returns the smallest BigInt in an array.
This function is available exclusively from es-toolkit/bigint to avoid potential conflicts with similar functions for other numeric types.
Usage
min(nums)
Use min when you want the smallest of several BigInts. Math.min cannot accept BigInts at all, so this is the way to compare them.
Because BigInts are compared exactly, values that number would round to the same thing stay distinguishable.
There is no BigInt that means "no minimum" — BigInt has no NaN and no Infinity — so an empty array throws instead of returning a placeholder.
Parameters
The array of BigInts to search.
Returns
Returns the smallest BigInt in the array.
Throws
Throws a RangeError if the array is empty.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.