Checks if value is array-like. A value is considered array-like if it's not a function and has a value.length that's an integer greater than or equal to 0 and less than or equal to Number.MAX_SAFE_INTEGER.
value
function
value.length
0
Number.MAX_SAFE_INTEGER
1.0.0
isArrayLike([1, 2, 3]); // => true Copy
isArrayLike([1, 2, 3]); // => true
isArrayLike(document.body.children); // => true Copy
isArrayLike(document.body.children); // => true
isArrayLike("abc"); // => true Copy
isArrayLike("abc"); // => true
isArrayLike(() => 0); // => false Copy
isArrayLike(() => 0); // => false
Checks if
valueis array-like. A value is considered array-like if it's not afunctionand has avalue.lengththat's an integer greater than or equal to0and less than or equal toNumber.MAX_SAFE_INTEGER.