DEV Community

Discussion on: JavaScript: How to Remove Duplicate Values from Arrays

Collapse
 
will_devs profile image
Will Harris

Thanks James!

Because the Set object implements the iterator property, we can use the ES6 spread syntax to cast the values from the Set into an array.

It really is doing the same thing as the second part of that example, where I called Array.from().

Collapse
 
jaymcconnon profile image
James McConnon

Thankyou that makes sense. Spread operator has been a tough one to learn for me. I always feel like i kind if have an idea of what it is doing in one situation but struggle to use it myself.