Skip to content

Commit

Permalink
Added JavaScript solution to issue wzhouwzhou#323
Browse files Browse the repository at this point in the history
  • Loading branch information
jagw1re committed Oct 4, 2019
1 parent 3ed760b commit b1b9882
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions javascript/remove_duplicates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Define array for duplicates to be removed
const array = [2, 5, 2, 6, 8];
// Create set from array (only adds non-duplicates) and print
const unique = Array.from(new Set(array));
console.log(unique);

0 comments on commit b1b9882

Please sign in to comment.