JavaScript. How to Compare Input Arrays
问题 I'm stuck with this problem for 3 days now... Someone please help me. Challenge 5 Construct a function intersection that compares input arrays and returns a new array with elements found in all of the inputs. function intersection(arrayOfArrays) { } console.log(intersection([[5, 10, 15, 20], [15, 88, 1, 5, 7], [1, 10, 15, 5, 20]])); // should log: [5, 15] 回答1: You could reduce the array by filtering with just checking if the other array contains the value. This works for arrays with unique