Skip to content

Commit b1b9882

Browse files
committed
Added JavaScript solution to issue wzhouwzhou#323
1 parent 3ed760b commit b1b9882

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

javascript/remove_duplicates.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Define array for duplicates to be removed
2+
const array = [2, 5, 2, 6, 8];
3+
// Create set from array (only adds non-duplicates) and print
4+
const unique = Array.from(new Set(array));
5+
console.log(unique);

0 commit comments

Comments
 (0)