Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/arrays/intersectionWith

Index

Functions

Functions

Const intersectionWith

  • intersectionWith(collection: Array<any>, comparsion: Array<any>, comparator?: Function): Array<any>
  • Function to find the intersection result between two array with a given comparator

    example

    intersecionWith([{x: 1, y: 2}, {x: 2, y: 3}], [{x: 2, y: 3}, {x: 4, y: 5}], (arrVal, otherVal) => arrVal.x === otherVal.x) // return [{x: 2, y: 3}]

    example

    intersectionWith([1, 2, 3], [3, 4, 5], undefined); // return [3]

    Parameters

    • collection: Array<any>
    • comparsion: Array<any>
    • Optional comparator: Function

    Returns Array<any>

    {Array}

Generated using TypeDoc