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
value.length
0
Number.MAX_SAFE_INTEGER
The value to check.
Returns true if value is array-like, else false.
true
false
5.3.0
isArrayLike([1, 2, 3])// => trueisArrayLike(document.body.children)// => trueisArrayLike('abc')// => trueisArrayLike(Function)// => false Copy
isArrayLike([1, 2, 3])// => trueisArrayLike(document.body.children)// => trueisArrayLike('abc')// => trueisArrayLike(Function)// => false
Checks if
value
is array-like. A value is considered array-like if it's not a function and has avalue.length
that's an integer greater than or equal to0
and less than or equal toNumber.MAX_SAFE_INTEGER
.