Options
All
  • Public
  • Public/Protected
  • All
Menu

Module reject

Index

References

Functions Collection

References

Renames and re-exports __type

Collection Functions

  • reject<T>(collection: Collection<T>, predicate: CollectionIteratee<T, any>): T[]
  • The opposite of filter this method returns the elements of collection that predicate does not return truthy for.

    since

    5.9.0

    see

    pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, filter

    example
    const users = [
    { 'user': 'barney', 'active': true },
    { 'user': 'fred', 'active': false }
    ]

    reject(users, ({ active }) => active)
    // => objects for ['fred']

    Type parameters

    • T

    Parameters

    • collection: Collection<T>

      The collection to iterate over.

    • predicate: CollectionIteratee<T, any>

      The function invoked per iteration.

    Returns T[]

    Returns the new filtered array.