News for hackers. Stuff that matters.
Re:Stop writing For loops. Start using underscore. by mathias on Monday February 10, 2014 @04:07AM (#7209916)
Another example is:

    _.forEach(array, function(item) {
      doSomething();
      if (condition) {
        // exits iteration early
        return false;
      }
    });
This is just not possible with native `Array#forEach` – you’d have to use a plain `for` loop with a conditional `break` statement instead, or rewrite your code to use `Array#some`.

There are no comments on this comment yet.