// 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));
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter