Skip to content

Commit

Permalink
safer but slower toArray fallback, in light of .callee throwing in st…
Browse files Browse the repository at this point in the history
…rict mode.
  • Loading branch information
jashkenas committed Dec 20, 2010
1 parent a890afe commit b3a373a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return !!(obj && obj.concat && obj.unshift && !obj.callee);
return toString.call(obj) === '[object Array]';
};

// Is a given variable an arguments object?
Expand Down

0 comments on commit b3a373a

Please sign in to comment.