Last active
November 3, 2020 00:01
-
-
Save heanfig/825379a543ce137f0f2b65b4f2ed2b3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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