If you want to find the set difference between two sets, that is, you want all the elements of A that are not in B:
const A = [1, 4, 3, 2]
const B = [0, 2, 1, 2]
console.log(A.filter(n => !B.includes(n)))
If you want arithmetic differences between the elements of A and the corresponding elements of B, then please look to the other posted answers.