Answer the question
In order to leave comments, you need to log in
How does newSet() work?
I can't figure out how the new Set() method works. How does it create uniqueness? For example, I have an array let a = ['Q', 'W', 'E', 'W', 'R', 'R']
how to remove duplicate letters using new Set(). To return ['Q', 'W', 'E', 'R']. With the help of filter () I can do it, but new Set () has not yet been parsed.
Answer the question
In order to leave comments, you need to log in
https://learn.javascript.ru/map-set#set
[...new Set(a)]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question