function isArrayLike( obj ) {
// Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
type = toType( obj );
if ( isFunction( obj ) || isWindow( obj ) ) {
return false;
}
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
那位朋友可帮忙看下注释是什么意思?难道这个函数只支持 iOS 8.2?还有就是,这个是jQuery版本3.0之后的,把针对nodelist的判断给去除了
if ( obj.nodeType === 1 && length ) {
return true;
}
这个代码去掉了
ios8.2之前出过一个bug,在模拟器上没有出现:https://github.com/jquery/jqu...