* @private * @param {*} obj * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, * String ...)
(obj)
| 257 | * String ...) |
| 258 | */ |
| 259 | function isArrayLike(obj) { |
| 260 | if (obj == null || isWindow(obj)) { |
| 261 | return false; |
| 262 | } |
| 263 | |
| 264 | // Support: iOS 8.2 (not reproducible in simulator) |
| 265 | // "length" in obj used to prevent JIT error (gh-11508) |
| 266 | var length = "length" in Object(obj) && obj.length; |
| 267 | |
| 268 | if (obj.nodeType === NODE_TYPE_ELEMENT && length) { |
| 269 | return true; |
| 270 | } |
| 271 | |
| 272 | return isString(obj) || isArray(obj) || length === 0 || |
| 273 | typeof length === 'number' && length > 0 && (length - 1) in obj; |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * @ngdoc function |
no test coverage detected