Checks if `value` is a valid array-like length. **Note:** This method is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
isLength(3)
// => true
isLength(Number.MIN_VALUE)
// => false
isLength(Infinity)
// => false
isLength('3')
// => false
Name | Type | Attribute | Description |
---|---|---|---|
value | The value to check. |
{ "comment": "/**\r\n * Checks if `value` is a valid array-like length.\r\n *\r\n * **Note:** This method is loosely based on\r\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\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 a valid length, else `false`.\r\n * @example\r\n *\r\n * isLength(3)\r\n * // => true\r\n *\r\n * isLength(Number.MIN_VALUE)\r\n * // => false\r\n *\r\n * isLength(Infinity)\r\n * // => false\r\n *\r\n * isLength('3')\r\n * // => false\r\n */", "meta": { "range": [ 635, 765 ], "filename": "isLength.js", "lineno": 28, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100004760", "name": "isLength", "type": "FunctionDeclaration", "paramnames": [ "value" ] } }, "description": "Checks if `value` is a valid array-like length.\r\r**Note:** This method is loosely based on\r[`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).", "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 a valid length, else `false`." } ], "examples": [ "isLength(3)\r// => true\r\risLength(Number.MIN_VALUE)\r// => false\r\risLength(Infinity)\r// => false\r\risLength('3')\r// => false" ], "name": "isLength", "longname": "isLength", "kind": "function", "scope": "global", "___id": "T000002R000458", "___s": true, "filepath": "isLength.js" }