title: How to iterate over an array of objects with jquery templates each command
body: <p>In Javascript I have a <code>User</code> object that contains an array of <code>department</code> objects like so:</p>
  
  <pre><code>user = 
  {
     departments: [
          {id: 1, name: 'Department 1'},
          {id: 2, name: 'Department 2'},
          {id: 3, name: 'Department 3'}
     ]
  }
  </code></pre>
  
  <p>Using jquery templates (version 1.4.2) I want to render a <code>&lt;select&gt;</code> tag like so:</p>
  
  <pre><code>&lt;select name="departmentId" id="department"&gt;
      {{each departments}}
          &lt;option value="{{= id }}"&gt;{{= name }}&lt;/option&gt;
      {{/each}}   
  &lt;/select&gt;
  </code></pre>
  
  <p>This doesn't produce any values in the option elements. How do access the id and name properties of each of the department objects with the template.</p>