Created
March 14, 2018 15:22
-
-
Save sajaddp/966f4e3efa8d6c75b2ebb02eef068ed2 to your computer and use it in GitHub Desktop.
Removing Array Duplicates in ES6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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