Skip to content

Instantly share code, notes, and snippets.

@gregzanch
Created September 18, 2020 17:57
Show Gist options
  • Save gregzanch/8e49e1010dec838de5ed780c5960592a to your computer and use it in GitHub Desktop.
Save gregzanch/8e49e1010dec838de5ed780c5960592a to your computer and use it in GitHub Desktop.
some array operations
const diff = (A,B) => [A,B].map((x,i,a)=>x.filter(y=>!a[(i+1)%2].includes(y)));
const unique = (A,B) => [...new Set([...A, ...B])];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment