检测函数(临时记录)
function isArrayLikeObj(obj) { // For document.all if (getTypeString(obj) === 'HTMLAllCollection') { return true; } if (obj === null || typeof obj !== 'object') { return false; } if (Object.prototype.hasOwnProperty.call(obj, 'length') === false) { return false; } if (typeof obj.length !== 'number') { return false; } if (Number.isFinite(obj.length) === false) { return false; } if (typeof obj[Symbol.iterator] !== 'function') { return false; } if (obj.constructor === Array) { return false; } const LIMIT_LEN_VAL = Math.pow(2, 53) - 1; return obj.length >= 0 && obj.length < LIMIT_LEN_VAL; }
标签:判断,return,是否,length,LIMIT,obj,数组,false,typeof From: https://www.cnblogs.com/fanqshun/p/16743563.html