ES6. Union, intersection, difference
const a = ['html', 'css', 'js'],
b = ['js', 'php', 'python'],
union = [...new Set([...a, ...b])], // 'html','css', 'js', 'php', 'python'
intersection = a.filter(x => b.includes(x)), // 'js'
difference = a.filter(x => !b.includes(x)), // 'html','css'
symdifference = [...a.filter(x => !b.includes(x)), ...b.filter(x => !a.includes(x))]; // 'html','css', 'php', 'python'
Альтернатива symdifference
[...a,...b].filter(x=>!(a.includes(x) && b.includes(x)))