* @private * @param {*} obj * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...)
(obj)
| 74 | * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...) |
| 75 | */ |
| 76 | function isArrayLike(obj) { |
| 77 | if (!obj || (typeof obj.length !== 'number')) return false; |
| 78 | |
| 79 | // We have on object which has length property. Should we treat it as array? |
| 80 | if (typeof obj.hasOwnProperty != 'function' && |
| 81 | typeof obj.constructor != 'function') { |
| 82 | // This is here for IE8: it is a bogus object treat it as array; |
| 83 | return true; |
| 84 | } else { |
| 85 | return obj instanceof JQLite || // JQLite |
| 86 | (jQuery && obj instanceof jQuery) || // jQuery |
| 87 | toString.call(obj) !== '[object Object]' || // some browser native object |
| 88 | typeof obj.callee === 'function'; // arguments (on IE8 looks like regular obj) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | |
| 93 | /** |