janl/mustache.js — pull request #309 by yigitgenc (2013-05-02 10:48:09+00:00)
Title: 0.4.x

Now we can use loop helper object in each like Django template.

Example:
{{#foo}
{{loop.counter}} {{! The current iteration of the loop (1-indexed) }}
{{loop.counter0}} {{! The current iteration of the loop (0-indexed) }}
{{loop.revcounter}} {{! The number of iterations from the end of the loop (1-indexed) }}
{{loop.revcounter0}} {{! The number of iterations from the end of the loop (0-indexed) }}
{{loop.first}} {{! First object of the foo }}
{{loop.last}} {{! Last object of the foo }}
{{/foo}