Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save atamaniuc/926b2a17959878e5591d222d29d5c8b4 to your computer and use it in GitHub Desktop.
Save atamaniuc/926b2a17959878e5591d222d29d5c8b4 to your computer and use it in GitHub Desktop.
Removing Duplicate Arrays from an Array of Arrays
let bigArray = [["a", "b", "c"],
[1, 2, 3],
[true, true, false],
[":)", ":P", ":X"],
[true, false, false],
[1, 2, 3],
["foo", "zorb", "blarg"],
["a", "b", "c"]];
let uniqueArray = Array.from(new Set(bigArray.map(JSON.stringify)), JSON.parse);
console.log(uniqueArray);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment