title: looping n times with Handlebars
body: <blockquote>
    <p>there is already an answer here
    <a href="https://stackoverflow.com/questions/11924452/iterating-over-basic-for-loop-using-handlebars-js/11924998#11924998">Iterating over basic “for” loop using Handlebars.js</a>
    but it's from <strong>2012</strong> so maybe I can get a better solution now.</p>
  </blockquote>
  
  <p>I want to loop n times. If there are 5 containers to create I want to loop 5 times.</p>
  
  <p>I render my template with NodeJs and try to pass a count variable</p>
  
  <pre><code>res.render('myTemplate', {
     barCount: 3
  });
  </code></pre>
  
  <p>Currently I have to write</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;/div&gt;
  &lt;div id="bar3" class="bar"&gt;&lt;/div&gt;
  
  &lt;div class="container"&gt;
  &lt;/div&gt;
  &lt;div id="bar2" class="bar"&gt;&lt;/div&gt;
  
  &lt;div class="container"&gt;
  &lt;/div&gt;
  &lt;div id="bar1" class="bar"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>But I would like to write something like this</p>
  
  <pre><code>    {{#each barCount}}
          &lt;div class="container"&gt;&lt;/div&gt;        
          &lt;div id="bar{{barCount - this + 1}}" class="bar"&gt;&lt;/div&gt;
      {{/each}}
  </code></pre>
  
  <p>Do I still have to use a helper?</p>