Skip to content

Commit

Permalink
avoiding isFunction in _.include
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Feb 24, 2010
1 parent 7824d63 commit 412d2e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion underscore.js
Expand Up @@ -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;
});
Expand Down

0 comments on commit 412d2e4

Please sign in to comment.