For those not familiar with Handlebars.js. It’s a small templating engine built off of Mustache.

The Helper

Handlebars v1.0.rc.1

Usage

Example: We want to “stripe” every 3 rows by adding a specific class to our <div> .

{{#each people}} {{#everyOther @index 3 }} <div class="person highlightRow"> {{else}} <div class="person"> {{/everyOther}} <h1>{{firstName}} {{lastName}}</h1> <!-- Mmre info on person --> </div> {{/each}}

You can also imagine an example where you are making a <table> and you want every 20 rows to show the table columns.

Try it

I put up an example on JS Fiddle. You can edit the handlebar template and play with it yourself.