Quick way to to remove duplicate elements from a JavaScript Array

By making use of Sets and the spread operator, we can quickly strip the duplicates with a Set then turn it back into an array in no time. 


```
[…new Set([1, 'Graffino', 1, 'Graffino', "Wha!"])];
```

Will return: [1, "Graffino", "Wha!"]

nickciolpan
04 Sep 2020