intersectionBy(_ arrays: [Element]...,iteratee: (Element) -> Element) -> [Element]

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 uniqueness is computed.

Parameters

  • arrays: The arrays to inspect.
  • iteratee: The iteratee invoked per element.

Returns

Returns the new array of shared values.

[2.1, 1.2].intersectionBy([4.3, 2.4], iteratee: floor)
// -> [2.2]