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 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
1var myArray = ['a', 1, 'a', 2, '1'];
2
3let unique = [...new Set(myArray)];
4
5console.log(unique); // unique is ['a', 1, 2, '1']