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

    Parameters

    • collection: undefined | null | string

      The collection to iterate over.

    • Optionalpredicate: StringIterator<boolean>

      The function invoked per iteration.

    Returns string[]

    Returns the new filtered array.

  • Type Parameters

    • T
    • S

    Parameters

    • collection: undefined | null | List<T>
    • predicate: ListIteratorTypeGuard<T, S>

    Returns S[]

    _.filter

  • Type Parameters

    • T

    Parameters

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

    Returns T[]

    _.filter

  • Type Parameters

    • T extends object
    • S

    Parameters

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

    Returns S[]

    _.filter

  • Type Parameters

    • T extends object

    Parameters

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

    Returns T[keyof T][]

    _.filter