Function intersectionBy

  • This method is like intersection except that it accepts iteratee which is invoked for each element of each arrays to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument: (value).

    Type Parameters

    • T

    Parameters

    • Rest ...arrays: any[]

      The arrays to inspect.

      Rest

    Returns T[]

    Returns the new array of intersecting values.

    Since

    5.11.0

    Example

    intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)
    // => [2.1]