1var arr = [55, 44, 65,1,2,3,3,34,5];
2var unique = [...new Set(arr)]
3
4//just var unique = new Set(arr) wont be an array
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']
1let a = ["1", "1", "2", "3", "3", "1"];
2let unique = a.filter((item, i, ar) => ar.indexOf(item) === i);
3console.log(unique);
1const myArray = ['a', 1, 'a', 2, '1'];
2const unique = [...new Set(myArray)]; // ['a', 1, 2, '1']
1const categories = ['General', 'Exotic', 'Extreme', 'Extreme', 'General' ,'Water', 'Extreme']
2.filter((value, index, categoryArray) => categoryArray.indexOf(value) === index);
3
4This will return an array that has the unique category names
5['General', 'Exotic', 'Extreme', 'Water']
6
7