Skip to content

Commit

Permalink
change conditional to do less work
Browse files Browse the repository at this point in the history
  • Loading branch information
sonewman committed Jul 12, 2014
1 parent b2ac2ee commit cdf0ef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion foreach.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function forEach(array, fn, done) {
var results = []

;(function next(array, i) {
if ((i + 1) > l) return done(results)
if (i === l) return done(results)
var context = { done: function (r) {
results.push(r)
next(array, i + 1)
Expand Down

0 comments on commit cdf0ef1

Please sign in to comment.