MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / isArraylike

Function isArraylike

web/static/bower_components/jquery/src/core.js:480–499  ·  view source on GitHub ↗
( obj )

Source from the content-addressed store, hash-verified

478});
479
480function isArraylike( obj ) {
481
482 // Support: iOS 8.2 (not reproducible in simulator)
483 // `in` check used to prevent JIT error (gh-2145)
484 // hasOwn isn't used here due to false negatives
485 // regarding Nodelist length in IE
486 var length = "length" in obj && obj.length,
487 type = jQuery.type( obj );
488
489 if ( type === "function" || jQuery.isWindow( obj ) ) {
490 return false;
491 }
492
493 if ( obj.nodeType === 1 && length ) {
494 return true;
495 }
496
497 return type === "array" || length === 0 ||
498 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
499}
500
501return jQuery;
502});

Callers 1

core.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected