Returns the first element in the source that satisfies the predicate.
Type of items in the source.
Predicate function to determine if an element should be returned.
Collector that returns the first element in the source that satisfies the predicate.
const result = first<number>((x) => x > 1)([1, 2, 3]);console.log(result); // 2 Copy
const result = first<number>((x) => x > 1)([1, 2, 3]);console.log(result); // 2
Returns the first element in the source that satisfies the predicate.