title: Simplest way to get current item index within jQuery template
body: <p>I am passing an array of objects to jQuery template (official <code>jquery-tmpl</code> plugin):</p>
  
  <pre><code>$("#itemTmpl").tmpl(items).appendTo("body");
  
  &lt;script id="itemTmpl" type="text/x-jquery-tmpl"&gt;
      &lt;div class="item"&gt;Name: ${name}, Index: ${???}&lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>What is the easiest way to display item index in the template? Preferably without using separated external functions, without changing passed object structure, and without changing template structure (converting to <code>{{each}}</code>). Is there any built-in variable perhaps that stores current array index?</p>
  
  <p><strong>UPDATE</strong>
  I created <a href="http://bugs.jquery.com/ticket/7137" rel="noreferrer">a ticket</a> proposing to expose array index to template item but it was closed as invalid...</p>