I have an array of arrays:
var selected = [[1, 4, 5, 6], [1, 2, 3, 5, 7], [1, 4, 5, 6], [1, 7]];
Underscore.js has convenient union and intersection methods but they work on passing each array individually as arguments.
How would I go about it if the number of arrays on which the set operations are to be performed is arbitrary?
This question addresses something similar but it is for an array containing objects.