Options
All
  • Public
  • Public/Protected
  • All
Menu

Module pullAllWith

Index

References

Functions Array

References

Renames and re-exports __type

Array Functions

  • pullAllWith<T>(array: T[], values: T[], comparator: Comparator<T>): T[]
  • This method is like pullAll except that it accepts comparator which is invoked to compare elements of array to values. The comparator is invoked with two arguments: (arrVal, othVal).

    Note: Unlike differenceWith, this method mutates array.

    since

    5.11.0

    see

    pull, pullAll, pullAllBy, pullAt, remove, reject

    example
    const array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]

    pullAllWith(array, [{ 'x': 3, 'y': 4 }], isEqual)
    console.log(array)
    // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]

    Type parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • values: T[]

      The values to remove.

    • comparator: Comparator<T>

      The comparator invoked per element.

    Returns T[]

    Returns array.