DEV Community

loading...

Discussion on: JavaScript - remove duplicates from array

Collapse
ndom91 profile image
Nico Domino • Edited
const set = new Set([1, 2, 3, 1, 1, 2, 2, 3, 3])
console.log(set)
// Set {1, 2, 3}
console.log(Array.from(set))
// [ 1, 2, 3 ]
Enter fullscreen mode Exit fullscreen mode
Collapse
marklchaves profile image
mark l chaves

Perfect! Took the words right out of my mouth.

Collapse
diraskreact profile image
Dirask-React Author

Nice solution! Thanks for the tips. 😊🔥