janl/mustache.js — pull request #310 by yigitgenc (2013-05-02 10:49:06+00:00)
Title: Helpers

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}