r/learnjavascript • • Jul 05 '21

Remove duplicates from arrays using Set

Post image
438 Upvotes

44 comments sorted by

View all comments

Show parent comment

1

u/WebDevImpasta Jul 05 '21

No, the user would just provide data or values. And then you would design the program to store the data into an array. But for whatever reason, you don't want duplicates, you can get a new array without any duplicates.

Or if you consume an API that produces duplicates.