Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const arr1 = [1,2,3,4]
- const arr2 = [1,2,3,4,5]
- let difference = arr1
- .filter(x => !arr2.includes(x))
- .concat(arr2.filter(x => !arr1.includes(x)));
- console.log(difference);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement