JSFiddle - React, Tailwind, and code Playground
by Jessie Lau
JavaScript
function removeDuplicators(arr) {
var counter = {};
var returned = [];
for (var i = 0; i < arr.length; i++) {
if (returned.indexOf(arr[i]) == -1){
returned.push(arr[i]);
}
}
return returned;
}
console.log(removeDuplicators("hello, how are you guys"));
console.log(removeDuplicators([1, 1, 2, 3, 4, 5, 5, 6, 6, 6, 7, 7, 0, 8, 8]));