- find<Item>(predicate): ((source: readonly Item[]) => undefined | Item)
Parameters
- predicate: ((item: Item) => boolean)
- (item): boolean
Returns boolean
Returns ((source: readonly Item[]) => undefined | Item)
- (source): undefined | Item
Returns undefined | Item
Finds the first element in the source array that satisfies the provided predicate function.
Returns
undefined
if no element satisfies the predicate.Example