JavaScript JavaScript Array Iteration Methods Combining Array Methods Chaining Array Methods

Bert Witzel
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Bert Witzel
Front End Web Development Techdegree Graduate 21,058 Points

Another way to remove duplicates from an array

const numbers = [1, 1, 2, 3, 4, 3, 5, 5, 6, 7, 3, 8, 9, 10];
const unique = [...new Set(numbers)];
console.log(unique);

treehouse:~/workspace$ node iteration.js                              
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]