You can find all kinds of array unique implementations here:
http://jsperf.com/distinct-hash-vs-comparison/12
http://jsperf.com/array-unique-functional
I prefer functional styles such as:
var arr = ['lol', 1, 'fdgdfg', 'lol', 'dfgfg', 'car', 1, 'car', 'a', 'blah', 'b', 'c', 'd', '0', '1', '1', '2', '3', '3', '3', 'crazy', 'moot', 'car', 'lol', 1, 'fdgdfg', 'lol', 'dfgfg', 'car', 1, 'car', 'a', 'blah', 'b', 'c', 'd', '0', '1', '1', '2', '3', '3', '3', 'crazy', 'moot', 'car', 'lol', 1, 'fdgdfg'];
var newarr = arr.reduce(function (prev, cur) {
//console.log(prev, cur);
if (prev.indexOf(cur) < 0) prev.push(cur);
return prev;
}, []);
var secarr = arr.filter(function(element, index, array){
//console.log(element, array.indexOf(element), index);
return array.indexOf(element) >= index;
});
//reverses the order
var thirdarr = arr.filter(function (e, i, arr) {
//console.log(e, arr.lastIndexOf(e), i);
return arr.lastIndexOf(e) === i;
});
console.log(newarr);
console.log(secarr);
console.log(thirdarr);