1. Filter Unique Values ARRAYS
The Set object type was introduced in ES6, and along with ..., the 'spread' operator, we can use it to create a new array with only the unique values.
const array = [1, 1, 2, 3, 5, 5, 1] const uniqueArray = [...new Set(array)]; console.log(uniqueArray); // Result: [1, 2, 3, 5] Before ES6, isolating unique values would involve a lot more code than that!