loading...

re: Remove Duplicates In Array VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Cool haven't thought of using "Set" yet. You could also filter directly on the array: const unique = myArr.filter((value, index, array) => arra...
 

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)

 

Nice to know. Will try that next time.

code of conduct - report abuse