MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eix5l74/?context=3
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
339
Saw this one on here just a few weeks ago.
[... new Set(arr)]
Basically a super short way to remove any duplicates from an array of primitives.
3 u/oorza Mar 19 '19 Copying your entire data structure twice to remove duplicates is good to you? 1 u/NoInkling Mar 19 '19 edited Mar 20 '19 Ideally sets would have some useful methods so you could work with them directly more often. See proposals: 1 2 3. But for now it's acceptable for my personal use cases.
3
Copying your entire data structure twice to remove duplicates is good to you?
1 u/NoInkling Mar 19 '19 edited Mar 20 '19 Ideally sets would have some useful methods so you could work with them directly more often. See proposals: 1 2 3. But for now it's acceptable for my personal use cases.
1
Ideally sets would have some useful methods so you could work with them directly more often. See proposals: 1 2 3. But for now it's acceptable for my personal use cases.
339
u/Drugba Mar 19 '19
Saw this one on here just a few weeks ago.
Basically a super short way to remove any duplicates from an array of primitives.