title: Accessing array values in Meteor Template
body: <p>I have this simple array that I pass to the template;</p>
  
  <pre><code>Template.incomeTotals.total = function() {
    var array = [];
    array[0] = [100000, 59, 58900];
    return array;
  };
  </code></pre>
  
  <p>and then this HTML file;</p>
  
  <pre><code>&lt;body&gt;
   &lt;table&gt;
     {{&gt; incomeTotals}}
   &lt;/table&gt;
  &lt;/body&gt;
  
  &lt;template name="incomeTotals"&gt;
    {{#each total}}
     &lt;tr&gt;
      &lt;th&gt;{{.0}}&lt;/th&gt;
      &lt;th&gt;{{.1}}%&lt;/th&gt;
      &lt;th&gt;${{.2}}&lt;/th&gt;
     &lt;/tr&gt;
    {{/each}}
  &lt;/template&gt;
  </code></pre>
  
  <p>What I am trying to do is get these three values all displayed on the same row, but all the values come out on the second row as <code>100000,59,58900%</code>. I saw in a similar question where someone was using the form of <code>{{#each total.array}}</code> but I got no output when using that syntax.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Here's what ended up working for anyone else stumbling across this:</p>
  
  <pre><code>Template.incomeTotals.total = function() {
    var array = [];
    array[0] = {budgetTotal:100000, achievedAvg:59, sumTotals:58900};
    return array;
  };
  </code></pre>
  
  <p>HTML;</p>
  
  <pre><code>&lt;body&gt;
   &lt;table&gt;
     {{&gt; incomeTotals}}
   &lt;/table&gt;
  &lt;/body&gt;
  
  &lt;template name="incomeTotals"&gt;
    {{#each total}}
     &lt;tr&gt;
      &lt;th&gt;{{budgetTotal}}&lt;/th&gt;
      &lt;th&gt;{{achievedAvg}}%&lt;/th&gt;
      &lt;th&gt;${{sumTotals}}&lt;/th&gt;
     &lt;/tr&gt;
    {{/each}}
  &lt;/template&gt;
  </code></pre>