First of all, make a more manageable dataset:
var arrays = [
['1', '2', '3', '4'],
['1', '3'],
['1', '2', '3'],
['1', '2', '3', '4', '5'],
['1', '3', '4']
];
Then we want to get all the unique elements:
var elements = [].concat.apply([], arrays).filter(function(value, index, self) {
return self.indexOf(value) === index;
}); //["1", "2", "3", "4", "5"]
, , , , :
var out = elements.filter(function(item) {
return arrays.reduce(function(present, array) {
present = present && (array.indexOf(item) !== -1);
return present;
}, true);
});