Finding intersection in multiple arrays
You could get the values and take a Set
and filter with Set#has
.
var object = { filterA: ["1", "2", "3", "4"], filterB: ["2", "5", "6", "7"], filterN: ["2", "4", "7"] },
result = Object
.values(object)
.reduce((a, b) => b.filter(Set.prototype.has, new Set(a)));
console.log(result);