JSFiddle - React, Tailwind, and code Playground
JavaScript
uniq = function(array) {
var result = [];
for (var i = 0; i < array.length; i++) {
if (result.indexOf(array[i]) === -1) {
result.push(array[i]);
}
}
return result;
};
console.log(uniq([1, 2, 3, 3, 4, 4]));