jashkenas/underscore — pull request #1356 by landau (2013-11-20 02:17:12+00:00)
Title: Looping utility method

This pull request adds a utility method to making basic looping as simple as `_.loop(10, fn);`

`_.loop` makes use of the range method signature so a user can iterate from any start, stop and use step.

`_.loop` also can be lazily run by not providing the last param (the iterator). This will cause loop to return a function that can be run with the same range and make use of different iterator functions.

The tests for this show some basic examples, but you can probably imagine why this might be useful. More over, the docs for `_.range` state how `_.range` is handy when using `_.each`. Why not combine the two?! :smile: