DEV Community

Discussion on: 1 line of code: How to remove all duplicates from an Array

Collapse
 
qm3ster profile image
Mihail Malo

It's actually specced to preserve insertion order: developer.mozilla.org/en-US/docs/W...

(...spread operator calls y[Symbol.iterator], which is specced to be the same as what is returned by .values() on Set)

Thread Thread
 
michaelcurrin profile image
Michael Currin

Oh interesting, in Python it is unordered.