- find<V>(it, f): V | undefined
Parameters
- it: V[] | Iterable<V>
- f: ((v: V) => boolean)
- (v): boolean
Returns boolean
Returns V | undefined
- find<V>(it, f): Promise<V | undefined>
Parameters
- it: AsyncIterable<V>
- f: ((v: V) => boolean | Promise<boolean>)
- (v): boolean | Promise<boolean>
Returns boolean | Promise<boolean>
Returns Promise<V | undefined>
Returns first item from iterable
it
that matches predicatef
When using async iterables,
f
can be async as well.Param: it
Param: f
Returns