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`.
isArrayLike([1, 2, 3])
// => true
isArrayLike(document.body.children)
// => true
isArrayLike('abc')
// => true
isArrayLike(Function)
// => false
Name | Type | Attribute | Description |
---|---|---|---|
value | The value to check. |
{ "comment": "/**\r\n * Checks if `value` is array-like. A value is considered array-like if it's\r\n * not a function and has a `value.length` that's an integer greater than or\r\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\r\n *\r\n * @since 4.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\r\n * @example\r\n *\r\n * isArrayLike([1, 2, 3])\r\n * // => true\r\n *\r\n * isArrayLike(document.body.children)\r\n * // => true\r\n *\r\n * isArrayLike('abc')\r\n * // => true\r\n *\r\n * isArrayLike(Function)\r\n * // => false\r\n */", "meta": { "range": [ 641, 753 ], "filename": "isArrayLike.js", "lineno": 26, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100004236", "name": "isArrayLike", "type": "FunctionDeclaration", "paramnames": [ "value" ] } }, "description": "Checks if `value` is array-like. A value is considered array-like if it's\rnot a function and has a `value.length` that's an integer greater than or\requal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.", "since": "4.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Lang", "value": "Lang" } ], "params": [ { "type": { "names": [ "*" ] }, "description": "The value to check.", "name": "value" } ], "returns": [ { "type": { "names": [ "boolean" ] }, "description": "Returns `true` if `value` is array-like, else `false`." } ], "examples": [ "isArrayLike([1, 2, 3])\r// => true\r\risArrayLike(document.body.children)\r// => true\r\risArrayLike('abc')\r// => true\r\risArrayLike(Function)\r// => false" ], "name": "isArrayLike", "longname": "isArrayLike", "kind": "function", "scope": "global", "___id": "T000002R000424", "___s": true, "filepath": "isArrayLike.js" }