JSFiddle - React, Tailwind, and code Playground
by borisjavier
JavaScript
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
// usage example:
var a = ['a', 1, 2, 1, 3, 4, 5, 6, 5, 4, 3, 4, 3, 'a', 2, '1'];
a = a.filter((x, i, a) => a.indexOf(x) == i)
console.log(a)