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

Creates an array of unique values that are included in all of the provided arrays.

Parameters

  • arrays: The arrays to inspect.

Returns

Returns the new array of shared values.

[2,1].intersection([4,2], [1,2]
// -> [2]