usig set compare array javascript es6 code example Example: es6 compare two arrays let difference = arrA.filter(x => !arrB.includes(x));