Returns the smallest numeric value produced for the elements in the sequence.
Type of elements within the source iterable.
source
The source iterable.
Optional
Optional projection that extracts the numeric value for each element. Defaults to the element itself.
The minimum of the projected values.
Thrown when the sequence is empty.
The entire sequence is enumerated exactly once. Provide a selector when the elements are not already numeric.
const numbers = [3, 1, 5, 2, 4];const minNumber = min(numbers);console.log(minNumber); // 1const people = [ { name: 'Alice', age: 25 }, { name: 'Bob', age: 30 }, { name: 'Charlie', age: 22 },];const minAge = min(people, p => p.age);console.log(minAge); // 22 Copy
const numbers = [3, 1, 5, 2, 4];const minNumber = min(numbers);console.log(minNumber); // 1const people = [ { name: 'Alice', age: 25 }, { name: 'Bob', age: 30 }, { name: 'Charlie', age: 22 },];const minAge = min(people, p => p.age);console.log(minAge); // 22
Returns the smallest numeric value produced for the elements in the sequence.