loading...

re: 🚀 Quick tips! 3 ways to get unique values from an array. 💜 VIEW POST

FULL DISCUSSION
 

It seems that the [... new Set(arr)] is way faster than the other two.

jsbench.me/xnkapa5nxq/1

 

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.

code of conduct - report abuse