Here you can find the source of same()
// Extension to check if two arrays are identical Array.prototype.same = function() { for(var i = 1; i < this.length; i++) { if(this[i] !== this[0]) return false; }/*from w ww .ja va 2 s .co m*/ return true; }
Array.prototype.same = function(comparisons, unordered) { if (Object.prototype.toString.call(this) !== '[object Array]') { throw new TypeError("`this` must be Array, not " + typeof this); var arglen = arguments.length; if (arglen < 1) { throw new TypeError("`arguments` must have at least one comparison `Array`"); var firstarg = arguments[0]; ...
Array.prototype.same = function(obj) { var i = this.length; while (i--) { if (obj.contains(this[i])) { return false; };
Array.prototype.sameElementCount = function(arr) { var result = [], count = null; arr.sort(); for (var i = 0; i < arr.length;) { count = 1; for (var j = i + 1; j < arr.length; j++) { if (arr[i] == arr[j]) { count++; result.push([ arr[i], count ]); i += count; return result; };
function findMissing(arr1, arr2){ if((arr1.length) && (arr2.length) === 0){ return 0; if(arr1.same_values(arr2)){ return 0; for(num = 0; num < arr2.length; num++){ if(isInArray(arr2[num], arr1) !== true) return arr2[num]; ...