Javascript Array intersect(arr, comparer)
Array.prototype.intersect = function (arr, comparer) { comparer = comparer || EqualityComparer; return this.distinct(comparer).where(function (t) { return arr.contains(t, comparer); });//from w w w . j a v a2 s . c om };