title: How to increment helper variable count in meteor?
body: <p>I need to know about to increment helper variable count in meteor.</p>
  
  <p>For example :</p>
  
  <pre><code>    &lt;head&gt;
    &lt;title&gt;hello&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;h1&gt;Welcome to Meteor!&lt;/h1&gt;
  
    {{&gt; hello}}
  &lt;/body&gt;
  
  &lt;template name="hello"&gt;
  
    &lt;button&gt;Click Me&lt;/button&gt;
  
    {{#each arr}}
       {{counter}} &lt;!-- How to get the foo index here? --&gt; {{name}}
    {{/each}}
  &lt;/template&gt;
  </code></pre>
  
  <p>Js Code :</p>
  
  <pre><code> if (Meteor.isClient) {
    // counter starts at 0
  
  
    Template.hello.helpers({
      counter: function () {
        return Session.get('counter');
      }
    });
  
    Template.hello.helpers({
      arr: function () {
        console.log(Session.get('arrres'));
        return Session.get('arrres');
      }
    });
  
    Template.hello.events({
      'click button': function () {
        Session.set('counter', 0);
  
        Meteor.call('arrfun',10, function (error, res) {
          if (!error)
          { arrres = res;
            Session.set('arrres', arrres);
            console.log(res);
          }
          else{}
        } );
  
      }
    });
  }
  
  if (Meteor.isServer) {
    Meteor.startup(function () {
      // code to run on server at startup
  
      Meteor.methods({
  
        arrfun:function arrfun(properties, callback)
  
        {
          var obj = [];
          for(var i = 0 ; i &lt; 10; i++)
          {
            var obj1 = new Object();
            obj1.name = 'abc'+i;
            obj.push(obj1);
          }
          return obj;
        }
      });
    });
  }
  </code></pre>
  
  <p>The above 'arr' contains list of names that present in object.Now can iterate 'arr' it will comes names.</p>
  
  <p>now can we print names as like 1 abc
                                 2 xyz until 'arr' completed.</p>
  
  <p>So how can we print numbers from 1 to 'arr' length before names.</p>
  
  <p>So please suggest me what to do for this.</p>