////Difference b/w elements of two arrays const a = [1, 2, 3, 4, 5]; const b = [1, 2]; var difference = a.filter((x) => !b.includes(x)); console.log(difference); //[3,4,5]