檢測函數(臨時記錄)
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; }