// gives array of diff between the two let difference = arr1 .filter(x => !arr2.includes(x)) .concat(arr2.filter(x => !arr1.includes(x))); // separates the arrays so you know which array has which let difference1 = arr1.filter(x => !arr2.includes(x)); let difference2 = arr2.filter(x => !arr1.includes(x));