compare two arrays using for loop and return the difference javascript code example
Example: compare two arrays and return the difference javascript
let difference = arr1
.filter(x => !arr2.includes(x))
.concat(arr2.filter(x => !arr1.includes(x)));