mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
add _.isFinite - verifies is a number between Inf && -Inf
This commit is contained in:
@@ -812,6 +812,11 @@
|
|||||||
return toString.call(obj) == '[object Number]';
|
return toString.call(obj) == '[object Number]';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Is a givin number finite?
|
||||||
|
_.isFinite = function(obj) {
|
||||||
|
return obj > -1/0 && obj < 1/0 && obj === -obj;
|
||||||
|
};
|
||||||
|
|
||||||
// Is the given value `NaN`?
|
// Is the given value `NaN`?
|
||||||
_.isNaN = function(obj) {
|
_.isNaN = function(obj) {
|
||||||
// `NaN` is the only value for which `===` is not reflexive.
|
// `NaN` is the only value for which `===` is not reflexive.
|
||||||
|
|||||||
Reference in New Issue
Block a user