title: How do I iterate over an object within a Soy file when using Google closure templates?
body: <p>I want to create my own template which I can pass an object to, and have the Soy template iterate through the object and pull out the keys and values.</p>
  
  <p>If I have and object in JavaScript and call a Soy template:</p>
  
  <pre><code>var obj = {'one':'a', 'two':b, 'three':c};
  nameSpace.templateName({'paramValue': obj});
  </code></pre>
  
  <p>How do I get the <code>['one', 'two', 'three']</code> values? Usually I would use jQuery's <code>each()</code> function, but I am not sure how to do something similar in Soy files without converting the object to an array.</p>
  
  <p>The objects I am using have known form (there are no nested objects, or if there are, they are known ahead of time and go to known depth). Answers for this or the general object case with nested objects are welcome.</p>
  
  <pre><code>{namespace nameSpace}
  
  /**
   * Prints keys and values of the object
   * @param paramValue object with keys and values
   */
  {template .templateName}
      {$paramValue[0]}    // undefined
      {$paramValue.Keys}  // undefined
      {$paramValue.keys}  // undefined
      {$paramValue.one}   // prints 'a'
      {foreach $val in $paramValue}
        // never reached
      {/foreach} 
  {/template}
  </code></pre>