DEV Community

Discussion on: Sets in JavaScript

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Are set values unique, I can't remember, but if they are passing a string would be destructive, hello world would be helo wrd

Collapse
 
attacomsian profile image
Atta

Yes, Set values are unique. It will filter-out the duplicate characters if you pass a string to create a set.

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

So that's good for something I'm sure 😋