avoiding isFunction in _.include

This commit is contained in:
Jeremy Ashkenas
2010-02-24 12:47:40 -05:00
parent 7824d63ce8
commit 412d2e4486

View File

@@ -172,7 +172,7 @@
// Determine if a given value is included in the array or object using '==='.
_.include = function(obj, target) {
if (obj && _.isFunction(obj.indexOf)) return _.indexOf(obj, target) != -1;
if (obj && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
return !! _.detect(obj, function(value) {
return value === target;
});