Skip to content

Instantly share code, notes, and snippets.

@emmabostian
Created March 20, 2020 10:03
Show Gist options
  • Save emmabostian/c64bfd70006bd9dbd3001b4f7d2b3b0d to your computer and use it in GitHub Desktop.
Save emmabostian/c64bfd70006bd9dbd3001b4f7d2b3b0d to your computer and use it in GitHub Desktop.
function uniteUnique(...arr) {
let flatArray = arr.flat();
const set = new Set(flatArray);
return Array.from(set);
}
uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment