get all the elements in array which differece is 2 code example
Example 1: javascript difference between two arrays
let difference = arr1.filter(x => !arr2.includes(x));
Example 2: array differenc javascript
let difference = arr1.filter(x => !arr2.includes(x));