Here you can find the source of getUnique()
Array.prototype.getUnique = function () { var u = {}, a = []; for (var i = 0, l = this.length; i < l; ++i) { if (u.hasOwnProperty(this[i])) { continue;/*from w w w. j a v a 2 s . c o m*/ } a.push(this[i]); u[this[i]] = 1; } return a; } var a = [1, 0, 0, 2, 3, 2, 4, 6, 2, 4, 6]; console.log(a.getUnique());
Array.prototype.getUnique = function(){ var u = {}, a = []; for(var i = 0, l = this.length; i < l; ++i){ if(u.hasOwnProperty(this[i])) { continue; a.push(this[i]); u[this[i]] = 1; return a;
Array.prototype.getUnique = function(){ var u = {}, a = []; for(var i = 0, l = this.length; i < l; ++i){ if(u.hasOwnProperty(this[i])) { continue; a.push(this[i]); u[this[i]] = 1; return a;
Array.prototype.getUnique = function(){ var u = {}, a = []; for(var i = 0, l = this.length; i < l; ++i){ if(u.hasOwnProperty(this[i])) { continue; a.push(this[i]); u[this[i]] = 1; return a;
Array.prototype.getUnique = function(){ var o = {}, a = [], i, e; for(i = 0; e = this[i]; i++){o[e] = 1}; for(e in o) {a.push (e)}; return a;
Array.prototype.getUnique = function(){ var u = {}, a = []; for(var i = 0, l = this.length; i < l; ++i){ if(u.hasOwnProperty(this[i])) { continue; a.push(this[i]); u[this[i]] = 1; return a;
Array.prototype.getUnique = function(){ var u = {}, a = []; for(var i = 0, l = this.length; i < l; ++i){ if(u.hasOwnProperty(this[i])) { continue; a.push(this[i]); u[this[i]] = 1; return a; };
Array.prototype.getUnique = function(){ var that = this; for (var i = 0; i < that.length; i++){ for (var j = i+1; j < that.length; j++){ if(that[i] === that[j]){ that.splice(j, 1); j--; return that; };