Options
All
  • Public
  • Public/Protected
  • All
Menu

Module intersectionWith

Index

References

Functions Array

References

Renames and re-exports __type

Array Functions

  • intersectionWith<T>(...arrays: any[]): T[]
  • This method is like intersection except that it accepts comparator which is invoked to compare elements of arrays. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: (arrVal, othVal).

    since

    5.11.0

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

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

    Type parameters

    • T

    Parameters

    • Rest ...arrays: any[]

      The arrays to inspect.

    Returns T[]

    Returns the new array of intersecting values.