Checks if `value` is classified as a `Number` primitive or object. **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified as numbers, use the `Number.isFinite` method.
isNumber(3)
// => true
isNumber(Number.MIN_VALUE)
// => true
isNumber(Infinity)
// => true
isNumber('3')
// => false
Name | Type | Attribute | Description |
---|---|---|---|
value | The value to check. |
{ "comment": "/**\r\n * Checks if `value` is classified as a `Number` primitive or object.\r\n *\r\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\r\n * classified as numbers, use the `Number.isFinite` method.\r\n *\r\n * @since 0.1.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\r\n * @see isInteger, toInteger, toNumber\r\n * @example\r\n *\r\n * isNumber(3)\r\n * // => true\r\n *\r\n * isNumber(Number.MIN_VALUE)\r\n * // => true\r\n *\r\n * isNumber(Infinity)\r\n * // => true\r\n *\r\n * isNumber('3')\r\n * // => false\r\n */", "meta": { "range": [ 692, 828 ], "filename": "isNumber.js", "lineno": 29, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100005008", "name": "isNumber", "type": "FunctionDeclaration", "paramnames": [ "value" ] } }, "description": "Checks if `value` is classified as a `Number` primitive or object.\r\r**Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\rclassified as numbers, use the `Number.isFinite` method.", "since": "0.1.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 number, else `false`." } ], "see": [ "isInteger, toInteger, toNumber" ], "examples": [ "isNumber(3)\r// => true\r\risNumber(Number.MIN_VALUE)\r// => true\r\risNumber(Infinity)\r// => true\r\risNumber('3')\r// => false" ], "name": "isNumber", "longname": "isNumber", "kind": "function", "scope": "global", "___id": "T000002R000478", "___s": true, "filepath": "isNumber.js" }