mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
774 B
35 lines
774 B
9 years ago
|
var root = require('./_root');
|
||
|
|
||
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||
|
var nativeIsFinite = root.isFinite;
|
||
10 years ago
|
|
||
|
/**
|
||
|
* Checks if `value` is a finite primitive number.
|
||
|
*
|
||
9 years ago
|
* **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite).
|
||
10 years ago
|
*
|
||
|
* @static
|
||
|
* @memberOf _
|
||
|
* @category Lang
|
||
|
* @param {*} value The value to check.
|
||
|
* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
|
||
|
* @example
|
||
|
*
|
||
9 years ago
|
* _.isFinite(3);
|
||
10 years ago
|
* // => true
|
||
|
*
|
||
9 years ago
|
* _.isFinite(Number.MAX_VALUE);
|
||
|
* // => true
|
||
10 years ago
|
*
|
||
9 years ago
|
* _.isFinite(3.14);
|
||
|
* // => true
|
||
10 years ago
|
*
|
||
|
* _.isFinite(Infinity);
|
||
|
* // => false
|
||
|
*/
|
||
9 years ago
|
function isFinite(value) {
|
||
10 years ago
|
return typeof value == 'number' && nativeIsFinite(value);
|
||
9 years ago
|
}
|
||
10 years ago
|
|
||
|
module.exports = isFinite;
|