• Iterates over elements of collection, returning the first element predicate returns truthy for.

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 16,881 bytes
    • Micro-dash: 241 bytes

    Type Parameters

    • I
    • O

    Parameters

    • array: Nil | readonly I[]
    • predicate: ArrayNarrowingIteratee<O>
    • Optional fromIndex: number

    Returns Extract<I, O> | Extract<O, I> | undefined

  • Type Parameters

    • T

    Parameters

    • array: Nil | readonly T[]
    • predicate: ArrayIteratee<T, boolean>
    • Optional fromIndex: number

    Returns T | undefined

  • Type Parameters

    • I
    • T extends {}
    • O
    • F extends undefined | number = undefined

    Parameters

    • object: I
    • predicate: ValueNarrowingIteratee<T, O>
    • Optional fromIndex: F

    Returns IfCouldBe<F, number, undefined> | IfCouldBe<I, Nil, undefined> | PossibleValueMatches<T, O> | (DefiniteValueMatches<T, O> extends never
        ? undefined
        : never)

  • Type Parameters

    • I
    • T extends {}
    • O
    • F extends undefined | number = undefined

    Parameters

    • object: I
    • predicate: KeyNarrowingIteratee<T, O>
    • Optional fromIndex: F

    Returns IfCouldBe<F, number, undefined> | IfCouldBe<I, Nil, undefined> | PossibleKeyMatches<T, O> | (DefiniteKeyMatches<T, O> extends never
        ? undefined
        : never)

  • Type Parameters

    • T

    Parameters

    • object: Nil | T
    • predicate: ObjectIteratee<T, boolean>
    • Optional fromIndex: number

    Returns T[keyof T] | undefined