diff --git a/underscore.js b/underscore.js index 51398635d..b94cc0f9b 100644 --- a/underscore.js +++ b/underscore.js @@ -478,8 +478,9 @@ // Define the isArray, isDate, isFunction, isNumber, isRegExp, and // isString functions based on their toString identifiers. _.each(['Array', 'Date', 'Function', 'Number', 'RegExp', 'String'], function(type) { + var toString = Object.prototype.toString, typeString = '[object ' + type + ']'; _['is' + type] = function(obj) { - return Object.prototype.toString.call(obj) == '[object ' + type + ']'; + return toString.call(obj) == typeString; }; });