Function differenceWith

  • This method is like _.difference except that it accepts comparator which is invoked to compare elements of array to values. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: (arrVal, othVal).

    Example

    var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];

    _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
    // => [{ 'x': 2, 'y': 1 }]

    Type Parameters

    • T1

    • T2

    Parameters

    • array: undefined | null | List<T1>
    • Optional values: List<T2>

      The arrays to inspect.

    • Optional comparator: Comparator2<T1, T2>

      The comparator invoked per element.

    Returns T1[]

    Returns the new array of filtered values.

  • See

    _.differenceWith

    Type Parameters

    • T1

    • T2

    • T3

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • comparator: Comparator2<T1, T2 | T3>

    Returns T1[]

  • See

    _.differenceWith

    Type Parameters

    • T1

    • T2

    • T3

    • T4

    Parameters

    • array: undefined | null | List<T1>
    • values1: List<T2>
    • values2: List<T3>
    • Rest ...values: (List<T4> | Comparator2<T1, T2 | T3 | T4>)[]

    Returns T1[]

  • See

    _.differenceWith

    Type Parameters

    • T

    Parameters

    • array: undefined | null | List<T>
    • Rest ...values: List<T>[]

    Returns T[]

Generated using TypeDoc