Options
All
  • Public
  • Public/Protected
  • All
Menu

Module xorWith

Index

References

Functions Array

References

Renames and re-exports xorWith

Array Functions

  • xorWith<T>(comparator: Function, ...arrays: T[][]): T[]
  • This method is like xor except that it accepts comparator which is invoked to compare elements of arrays. The order of result values is determined by the order they occur in the arrays. The comparator is invoked with two arguments: (arrVal, othVal).

    since

    5.7.0

    see

    difference, union, unionBy, unionWith, without, xor, xorBy

    example
    const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
    const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]

    xorWith(objects, others, isEqual)
    // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]

    Type parameters

    • T

    Parameters

    • comparator: Function

      The comparator invoked per element.

    • Rest ...arrays: T[][]

      The arrays to inspect.

    Returns T[]

    Returns the new array of filtered values.