1// usage example:
2var myArray = ['a', 1, 'a', 2, '1'];
3var unique = myArray.filter((v, i, a) => a.indexOf(v) === i);
4
5// unique is ['a', 1, 2, '1']
1const my_array = [1, 2, 2, 3, 3, 4, 5, 5]
2const unique_array = [...new Set(my_array)];
3console.log(unique_array); // [1, 2, 3, 4, 5]