farcasmihai91
5/13/2018 - 6:24 AM

ES6 Set and Spread Array Unique

const sampleValues = [1, 4, 5, 2, 'a', 'e', 'b', 'e', 2, 2, 4];
const uniqueValues = [...new Set(sampleValues)]; 
console.log(uniqueValues); //[1, 4, 5, 2, "a", "e", "b"]