Returns an array of elements common to both input arrays.
The first array.
The second array.
A new array containing the elements found in both arrays.
intersection([1, 2, 3], [2, 3, 4]);// → [2, 3]intersection(["a", "b"], ["c", "d"]);// → [] Copy
intersection([1, 2, 3], [2, 3, 4]);// → [2, 3]intersection(["a", "b"], ["c", "d"]);// → []
1.0.0
Returns an array of elements common to both input arrays.