List of utility methods to do Array Repeat Check
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; return false; }; ... | |
isRepeat(arr)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; ... |