DEV Community

Discussion on: Remove Duplicates In Array

Collapse
 
miketalbot profile image
Mike Talbot ⭐

That is significantly slower though, the Set uses an O(1) lookup so the routine is O(N) whereas indexOf would make it O(N**2)

Collapse
 
juliandierkes profile image
Julian Dierkes

Nice to know. Will try that next time.