mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Merge pull request #524 from octatone/isFinite
New Feature: _.isFinite to compliment _.isNumber and _.isNaN
This commit is contained in:
@@ -824,6 +824,11 @@
|
||||
return toString.call(obj) == '[object Number]';
|
||||
};
|
||||
|
||||
// Is a givin number finite?
|
||||
_.isFinite = function(obj) {
|
||||
return _.isNumber(obj) && isFinite(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