Implement a function intersection(...arrays) that computes the intersection of arrays, returning a new array containing unique values present in all given arrays.
The function should:
Examples
intersection([1, 2, 3], [2, 3, 4]); // [2, 3] intersection([1, 2, 3], [2, 3, 4], [3]); // [3] intersection([1, 2], [3, 4]); // [] intersection([], [1, 2, 3]); // [] intersection([1, 2, 2, 3], [2, 2, 3, 4]); // [2, 3]
JavaScript Function
No test results yet
Click "Run" to execute tests