How can I get a list of unique values in an array? Do I always have to use a second array or is there something similar to java\'s hashmap in JavaScript?
I am going
Array.prototype.unique = function () { var dictionary = {}; var uniqueValues = []; for (var i = 0; i < this.length; i++) { if (dictionary[this[i]] == undefined){ dictionary[this[i]] = i; uniqueValues.push(this[i]); } } return uniqueValues; }