DEV Community

Discussion on: 3 ways to remove duplicates in an Array in Javascript

Collapse
 
eaallen profile image
Elijah Allen

The last two are problematic because you are essentially calling a for loop in a for loop which heavily increases how long the algorithms are going to take.

Using a set to remove duplicates is a great to solve this problem.