It seems that the [... new Set(arr)] is way faster than the other two.
[... new Set(arr)]
That's actually great to know too. Finally, my laziness is paying off. 😂
HA! Exactly my thought on this topic 😂
Set also reliably keep what is .add() first as well. But I never really tested [...new Set(arr)] on whether the sequence is kept.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.