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