I caught myself using this instead of the traditional loop:
_.each(_.range(count), function(i){ ... });
The disadvantage is the creation of an unnecessary array of sizes.
However, I prefer semantics, for example .each (.range (10,0, -1), ...); upon repeated repetition.
Is there a way to do lazy range iteration, e.g. with pythons xrange?
source share