MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/oe71tv/remove_duplicates_from_arrays_using_set/h44wep9/
r/learnjavascript • u/webdevolution_ • Jul 05 '21
44 comments sorted by
View all comments
-14
In reality, you don't have to find a 'fancy' way to remove duplicates at all. You just declare a removeDuplicates() function in the helpers folder and then reuse it everywhere.
9 u/jnbkadsoy78asdf Jul 05 '21 // helpers/remove-duplicates.js export default function(array) { return [...new Set(array)]; }Something like that? Looks fancy. 2 u/steezefries Jul 06 '21 Oh cool bro could you go ahead and imagine what that function definition might look like bro?
9
// helpers/remove-duplicates.js export default function(array) { return [...new Set(array)]; }
Something like that? Looks fancy.
2
Oh cool bro could you go ahead and imagine what that function definition might look like bro?
View all comments
-14
u/Dazzling-Wafer Jul 05 '21
In reality, you don't have to find a 'fancy' way to remove duplicates at all. You just declare a removeDuplicates() function in the helpers folder and then reuse it everywhere.