// Array with duplicates const arr = [7, 3, 1, 3, 3, 7]; // Dedupe using a Set, which is then spread into a new Array const deduped = [...new Set(arr)]; // -> [ 7, 3, 1 ]
I really dig the spread operator. There’s some more interesting stuff you can do with it.
I don’t run ads on my blog nor do I do this for profit. A donation however would always put a smile on my face though. Thanks!