Skip to content

Commit

Permalink
michaelficarra's proposed tweak to _.after
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Apr 15, 2011
1 parent ea44179 commit 6f25cca
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 @@ -512,7 +512,7 @@
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
return function() {
if (--times === 0) { return func.apply(this, arguments); }
if (--times < 1) { return func.apply(this, arguments); }
};
};

Expand Down

0 comments on commit 6f25cca

Please sign in to comment.