Skip to content

Instantly share code, notes, and snippets.

@sajaddp
Created March 14, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajaddp/966f4e3efa8d6c75b2ebb02eef068ed2 to your computer and use it in GitHub Desktop.
Save sajaddp/966f4e3efa8d6c75b2ebb02eef068ed2 to your computer and use it in GitHub Desktop.
Removing Array Duplicates in ES6
let array = [1,2,3,3,5,4,8,9,5,2,3,1,2,2,1,1,3,6,4,8,9,1,2,5,3,4,6,9,7,8,9];
let unique_array = [...new Set(array)]; // [1, 2, 3, 5, 4, 8, 9, 6, 7]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment