mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +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]';
|
||||
};
|
||||
|
||||
// Is a givin number finite?
|
||||
_.isFinite = function(obj) {
|
||||
return obj > -1/0 && obj < 1/0 && obj === -obj;
|
||||
};
|
||||
|
||||
// Is the given value `NaN`?
|
||||
_.isNaN = function(obj) {
|
||||
// `NaN` is the only value for which `===` is not reflexive.
|
||||
|
||||
Reference in New Issue
Block a user