added _.isBoolean function

This commit is contained in:
John Wright
2010-02-26 21:46:58 -07:00
parent d1ccc1e841
commit bd271e4794
2 changed files with 18 additions and 0 deletions

View File

@@ -525,6 +525,11 @@
return (obj === +obj) || (toString.call(obj) === '[object Number]');
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return (toString.call(obj) === '[object Boolean]');
};
// Is a given value a date?
_.isDate = function(obj) {
return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear);