Options
All
  • Public
  • Public/Protected
  • All
Menu

Module pullAllBy

Index

References

Functions Array

References

Renames and re-exports pullAllBy

Array Functions

  • pullAllBy<T>(array: T[], values: T[], iteratee: KeyIteratee | ArrayIteratee<T, any>): T[]
  • This method is like pullAll except that it accepts iteratee which is invoked for each element of array and values to generate the criterion by which they're compared. The iteratee is invoked with one argument: (value).

    Note: Unlike differenceBy, this method mutates array.

    since

    5.11.0

    see

    pull, pullAll, pullAllWith, pullAt, remove, reject

    example
    const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]

    pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x')
    console.log(array)
    // => [{ 'x': 2 }]

    Type parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • values: T[]

      The values to remove.

    • iteratee: KeyIteratee | ArrayIteratee<T, any>

      The iteratee invoked per element.

    Returns T[]

    Returns array.