Skip to content

Instantly share code, notes, and snippets.

@heanfig
Last active November 3, 2020 00:01
Show Gist options
  • Save heanfig/825379a543ce137f0f2b65b4f2ed2b3e to your computer and use it in GitHub Desktop.
Save heanfig/825379a543ce137f0f2b65b4f2ed2b3e to your computer and use it in GitHub Desktop.
function sym(...args) {
return args.reduce( (a,b,i) => {
return [...new Set([
...a.filter(item => !b.find(aux=>aux===item)),
...b.filter(item => !a.find(aux=>aux===item) )
].sort((a,b)=>a-b))]
},[]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment