MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / isArrayLike

Function isArrayLike

code/songhop/www/lib/angular/angular.js:257–270  ·  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

255 * String ...)
256 */
257function isArrayLike(obj) {
258 if (obj == null || isWindow(obj)) {
259 return false;
260 }
261
262 var length = obj.length;
263
264 if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
265 return true;
266 }
267
268 return isString(obj) || isArray(obj) || length === 0 ||
269 typeof length === 'number' && length > 0 && (length - 1) in obj;
270}
271
272/**
273 * @ngdoc function

Callers 5

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

Calls 2

isWindowFunction · 0.70
isStringFunction · 0.70

Tested by

no test coverage detected