how to compare array elements with string in js code example Example: es6 compare two arrays let difference = arrA.filter(x => !arrB.includes(x));