code: function isArrayLikeObject (subject) {
    var length = subject.length
  
    if (
      typeof subject === 'function'
      || Object(subject) !== subject
      || typeof length !== 'number'
      // `window` already has a property `length`
      || 'setInterval' in subject
    ) {
      return false
    }
  
    return length === 0
      || length > 0 && (length - 1) in subject
  }
docs: altered from jQuery