# intersection

Use
import { intersection } from 'util-snippets'

/**
 * Example:intersection([1, 2, 3], [4, 3, 2]); // [2, 3]
 */

intersection(array1,array2)
Code
const intersection = (a: [], b: []) => {
  const s = new Set(b);
  return a.filter(x => s.has(x));
};