DEV Community

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

Collapse
 
savagepixie profile image
SavagePixie

Sets don't come with the same prototype functions as arrays. They have a forEach method, but no map or filter, for example (I think). The spread operator and square braces there are simply extracting the values from the set and turning them into an array.