Here you can find the source of isRepeat()
Array.prototype.isRepeat = function (){ var nary=this.sort(); for(var i=0;i<this.length;i++){ if (nary[i]==nary[i+1]){ return true; }/* w w w.jav a 2s . c o m*/ } return false; };
Array.prototype.isRepeat = function (arr) { var hash = {}; for (var i = 0, elem; (elem = arr[i]) != null; i++) { if (hash[arr[i]]) { return true; hash[arr[i]] = true; return false; ...