UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

12 lines (10 loc) 241 B
export function first(source, predicate = () => true) { let i = 0; for (const item of source) { if (predicate(item, i++)) { return item; } } return undefined; } //# sourceMappingURL=first.mjs.map