MCPcopy Create free account
hub / github.com/aosabook/500lines / isArrayLike

Function isArrayLike

spreadsheet/code/lib/angular.js:275–288  ·  view source on GitHub ↗

* @private * @param {*} obj * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, * String ...)

(obj)

Source from the content-addressed store, hash-verified

273 * String ...)
274 */
275function isArrayLike(obj) {
276 if (obj == null || isWindow(obj)) {
277 return false;
278 }
279
280 var length = obj.length;
281
282 if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
283 return true;
284 }
285
286 return isString(obj) || isArray(obj) || length === 0 ||
287 typeof length === 'number' && length > 0 && (length - 1) in obj;
288}
289
290/**
291 * @ngdoc function

Callers 5

forEachFunction · 0.85
$watchCollectionActionFunction · 0.85
orderByFilterFunction · 0.85
angular.jsFile · 0.85

Calls 2

isWindowFunction · 0.85
isStringFunction · 0.85

Tested by

no test coverage detected