Function pullAllWith

  • 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.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • values: T[]

      The values to remove.

    • Optionalcomparator: ((value: T, othValue: any) => boolean)

      The comparator invoked per element.

        • (value, othValue): boolean
        • Parameters

          • value: T
          • othValue: any

          Returns boolean

    Returns T[]

    Returns array.

    4.6.0

    pull, pullAll, pullAllBy, pullAt, remove, reject

    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 }]