Returns true if both objects are the same type and have same length property

@method sameLength
10826
function sameLength(a, b) {
    return typeof a === typeof b &&
      a && b &&
      a.length === b.length;
  }
357028
function(a, b) {
    if (a !== b) {
      const atype = whatis(a);
      const btype = whatis(b);

      if (atype === btype) {
        return _equal.hasOwnProperty(atype) ? _equal[atype](a, b) : a == b;
      }

      return false;
    }

    return true;
  }
97351
function getLength(value) {
  if (typeof value !== 'object') {
    return 0;
  }

  if (isValue(value.length)) {
    return value.length;
  }

  return Object.keys(value).length;
}
162577
protected boolean sameValue(Object newValue, Object currentValue) {
        if (newValue == NOT_FOUND) {
            return true;
        }
        if (currentValue == NOT_FOUND) {
            currentValue = Undefined.instance;
        }
        // Special rules for numbers: NaN is considered the same value,
        // while zeroes with different signs are considered different.
        if (currentValue instanceof Number && newValue instanceof Number) {
            double d1 = ((Number)currentValue).doubleValue();
            double d2 = ((Number)newValue).doubleValue();
            if (Double.isNaN(d1) && Double.isNaN(d2)) {
                return true;
            }
            if (d1 == 0.0 && Double.doubleToLongBits(d1) != Double.doubleToLongBits(d2)) {
                return false;
            }
        }
        return ScriptRuntime.shallowEq(currentValue, newValue);
    }
427752
public boolean similar(Object other) {
        if (!(other instanceof JSONArray)) {
            return false;
        }
        int len = this.length();
        if (len != ((JSONArray)other).length()) {
            return false;
        }
        for (int i = 0; i < len; i += 1) {
            Object valueThis = this.get(i);
            Object valueOther = ((JSONArray)other).get(i);
            if (valueThis instanceof JSONObject) {
                if (!((JSONObject)valueThis).similar(valueOther)) {
                    return false;
                }
            } else if (valueThis instanceof JSONArray) {
                if (!((JSONArray)valueThis).similar(valueOther)) {
                    return false;
                }
            } else if (!valueThis.equals(valueOther)) {
                return false;
            }
        }
        return true;
    }
923066
def identical(self, other):
        
        try:
            return (self.name == other.name and
                    self._all_compat(other, 'identical'))
        except (TypeError, AttributeError):
            return False
1245697
function ( val1, val2 ) {
            var result = false, isSame = true, val1Length, val2Length;
    
            if ( this.isArray(val1) && this.isArray(val2) ) {
                val1Length = val1.length;
                val2Length = val2.length;
    
                if ( val1Length === val2Length && val1Length ) {
                    for ( var i = 0; i < val1Length; ++i ) {
                        if ( !this.isEqual(val1[i], val2[i]) ) {
                            isSame = false;
                            break;
                        }
                    }
                    result = isSame;
                } else if ( !val1Length && !val2Length ) {
                    result = true;
                } else {
    				result = ( val1 === val2 );
    			}
            } else if ( this.isObject(val1) && this.isObject(val2) ) {
                val1Length = $B.object.length( val1 );
                val2Length = $B.object.length( val2 );
    
                if ( val1Length === val2Length && val1Length ) {
                    for ( var key in val1 ) {
                        if ( !this.isEqual(val1[key], val2[key]) ) {
                            isSame = false;
                            break;
                        }
                    }
                    result = isSame;
    			} else if ( !val1Length && !val2Length ) {
    				result = true;
    			} else {
                    result = ( val1 === val2 );
                }
            } else {
                result = ( val1 === val2 );
            }
    
            return result;
        }
1046542
function equal (a, b) {
	return (a.id || stringify(a)) === (b.id || stringify(b))
}
702348
function objectEqual(a, b, m) {
  if (!isValue(a) || !isValue(b)) {
    return false;
  }

  if (a.prototype !== b.prototype) {
    return false;
  }

  var i;
  if (m) {
    for (i = 0; i < m.length; i++) {
      if ((m[i][0] === a && m[i][1] === b)
      ||  (m[i][0] === b && m[i][1] === a)) {
        return true;
      }
    }
  } else {
    m = [];
  }

  try {
    var ka = enumerable(a);
    var kb = enumerable(b);
  } catch (ex) {
    return false;
  }

  ka.sort();
  kb.sort();

  if (!iterableEqual(ka, kb)) {
    return false;
  }

  m.push([ a, b ]);

  var key;
  for (i = ka.length - 1; i >= 0; i--) {
    key = ka[i];
    if (!deepEqual(a[key], b[key], m)) {
      return false;
    }
  }

  return true;
}
1265067
def _is_same_type_as_root(self, obj):
        
        if not self.ALLOWS_SAME_TYPE_AS_ROOT_COLLECT:
            obj_model = get_model_from_instance(obj)
            obj_key = get_key_from_instance(obj)
            is_same_type_as_root = obj_model == self.root_obj_model and obj_key != self.root_obj_key

            if is_same_type_as_root:
                self.emit_event(type='same_type_as_root', obj=obj)

            return is_same_type_as_root
        else:
            return False
1206071
function minlength (val, min) {
  if (typeof val === 'string') {
    return isInteger(min, 10) && val.length >= parseInt(min, 10)
  } else if (Array.isArray(val)) {
    return val.length >= parseInt(min, 10)
  } else {
    return false
  }
}
124252
function equals( a, b ) {
   const aKeys = Object.keys( a );
   const bKeys = Object.keys( b );
   return aKeys.length === bKeys.length && aKeys.every( key => key in b && a[ key ] === b[ key ] );
}
841438
public static boolean isEqual(Object o1, Object o2) {
        return isEqual(str(o1), str(o2));
    }
50860
public static boolean sameList(final Object[] a, final Object[] b) {
    if (a == null || b == null || a.length != b.length) {
      return false;
    }
    for (int i = 0; i < a.length; i++) {
      if (!a[i].equals(b[i])) {
        return false;
      }
    }
    return true;
  }
1162898
function isDeepEqual(obj1, obj2, isStrict) {
      if (typeof obj1 !== typeof obj2) return false;
      if (isArr(obj1) && isArr(obj2)) {
        if (obj1.length !== obj2.length) return false;
        for (var i = 0; i < obj1.length; i++) {
          if (!isDeepEqual(obj1[i], obj2[i], isStrict)) return false;
        }
        return true;
      }
      else if (isObj(obj1) && isObj(obj2)) {
        if (len(obj1) !== len(obj2)) return false;
        var ks = keys(obj1);
        if (isStrict && !isDeepEqual(ks, keys(obj2))) return false;
        for (var i = 0; i < ks.length; i++) {
          if (
            !has(obj2, ks[i]) || !isDeepEqual(obj1[ks[i]], obj2[ks[i]], isStrict)
          ) return false;
        }
        return true;
      }
      else return obj1 === obj2;
    }
15220
function objectSignaturesMatch(object1, object2){

    // because typeof null is object we need to check for it here before Object.keys
    if(object1 === null && object2 === null){
      return true;
    }

    // if the objects have different lengths of keys we should fail immediatly
    if (Object.keys(object1).length !== Object.keys(object2).length) {
      return false;
    }

    // loop over all the keys in object1 (we know the objects have the same number of keys at this point)
    for(var key in object1) {

      // if the keys match keep checking if not we have a mismatch
      if(typeof object1[key] === typeof object2[key]) {

        if(typeof object1[key] === null && typeof object2[key] === null) {

        }

        // if the keys represent an object make sure that it matches.
        else if(object1[key] instanceof Array && object2[key] instanceof Array) {
          if(!arrySignaturesMatch(object1[key],object2[key])){
            return false;
          }
        }

        // if the keys represent an array make sure it matches
        else if(typeof object1[key] === "object" && typeof object2[key] === "object") {
          if(!objectSignaturesMatch(object1[key],object2[key])){
            return false;
          }
        }

      }
    }
    return true;
  }
122917
function areEqual(a,b) {
	var same = true;
	$.each(a, function(i, _) {
		if (b[i] === undefined || a[i] !== b[i]) {
			same = false;
			return false;
		}
	});
	return same;
}