Simple sample function to intersect a bunch of arrays

function intersect(...arrays) {
  return arrays.reduce((acc, cur) => {
    if (acc.length === 0) {
      return cur;
    }

    return acc.filter(role => cur.includes(role));
  }, []);
}