• Iterates over elements of collection, returning the first element predicate returns truthy for. The predicate is invoked with three arguments: (value, index|key, collection).

    Type Parameters

    • T
    • S

    Parameters

    • collection: undefined | null | List<T>

      The collection to search.

    • predicate: ListIteratorTypeGuard<T, S>

      The function invoked per iteration.

    • OptionalfromIndex: number

      The index to search from.

    Returns undefined | S

    Returns the matched element, else undefined.

  • Type Parameters

    • T

    Parameters

    • collection: undefined | null | List<T>
    • Optionalpredicate: ListIterateeCustom<T, boolean>
    • OptionalfromIndex: number

    Returns undefined | T

    _.find

  • Type Parameters

    • T extends object
    • S

    Parameters

    • collection: undefined | null | T
    • predicate: ObjectIteratorTypeGuard<T, S>
    • OptionalfromIndex: number

    Returns undefined | S

    _.find

  • Type Parameters

    • T extends object

    Parameters

    • collection: undefined | null | T
    • Optionalpredicate: ObjectIterateeCustom<T, boolean>
    • OptionalfromIndex: number

    Returns undefined | T[keyof T]

    _.find