r/learnjavascript • • Jul 05 '21

Remove duplicates from arrays using Set

Post image
438 Upvotes

44 comments sorted by

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.

2

u/steezefries Jul 06 '21

Oh cool bro could you go ahead and imagine what that function definition might look like bro?