Skip to content

Instantly share code, notes, and snippets.

@sajaddp sajaddp/unique.js
Created Mar 14, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.