Here you can find the source of unique(a)
/**// ww w. j av a2s . c o m * This file contains prototype extensions for default javascript handlers */ /** * Array unique for javascript array. * * @type {Array.prototype.unique} * * @returns {array} */ Array.prototype.unique = function(a) { return function(){return this.filter(a)}}(function(a,b,c){return c.indexOf(a,b+1)<0 });
Array.prototype.unique = function() var h = {}; var r = []; this.forEach(function (item) { h[item] = true; }); for (var item in h) r.push(item); return r;
Array.prototype.unique = function() { var uniqueArray = new Array(); for(var i = 0; i < this.length; i++) { for(var j = i+1; j < this.length+1; j++) { if (this[i] !== null && this[i] === this[j]) this[j] = null; for(i = 0; i < this.length; i++) { ...
Array.prototype.unique=function(a){ return function(){return this.filter(a)}}(function(a,b,c){return c.indexOf(a,b+1)<0 });
Array.prototype.unique = function(a) { return function(){return this.filter(a)}}(function(a,b,c){return c.indexOf(a,b+1)<0 });
x = '' Array.prototype.unique=function(a){ return function(){return this.filter(a)}}(function(a,b,c){return c.indexOf(a,b+1)<0 }); function getCombi(vect,res,n,r){ if(n == 0){ x = x + res +":"; }else{ for(var i = 0; i < r; i++){ ...
Array.prototype.unique = function(b) { var a = [], i, l = this.length; for (i = 0; i < l; i++) { if (a.indexOf(this[i], 0, b) < 0) { a.push(this[i]); return a; }; ...
Array.prototype.unique = function(b) { var a = [], i, l = this.length; for (i = 0; i < l; i++) { if (a.indexOf(this[i], 0, b) < 0) { a.push(this[i]); return a; }; ...
Array.prototype.unique = function(callback) { var o = {}, i, l = this.length, r = []; for (i=0; i<l; i+=1) { var val = callback(this[i]); o[val] = this[i]; for (i in o) { r.push(o[i]); return r; };
Array.prototype.unique = function(data) { data.sort(); var re = [ data[0] ]; var length = data.length; for (var i = 1; i < length; i++) { if (data[i] !== re[re.length - 1]) { re.push(data[i]); return re; };