title: Knockout JS Iterate a array of object using JSON
body: <p>Below is my JSON response. I need to use knockout foreach to iterate through this array and display this array as a accordion. In this case "Nissan" will be accordion title and clicking on it expand to show other details. I could not find a way to print the key ("Nissan" or "Ford") and create a accordion correctly.It will be a dynamic array and key will be different. I think I would need nested foreach and ran into issues when iterates the second. Thanks in advance.        </p>
  
  <pre><code>  var ViewModel = function() {
      var self = this;
      this.entries =
         {
          "Nissan": [
              {"model":"Sentra", "doors":4},
              {"model":"Maxima", "doors":4}
          ],
          "Ford": [
              {"model":"Taurus", "doors":4},
              {"model":"Escort", "doors":4}
          ]
  }
      ;
  
  
  &lt;table&gt;
  &lt;tbody data-bind="foreach: entries"&gt;
      &lt;tr&gt;
          &lt;td data-bind="foreach: $parent.data()"&gt;
              &lt;a href="#" data-bind="text: model"&gt;&lt;/a&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><a href="http://jsfiddle.net/A7ppE/107/" rel="nofollow noreferrer">Fiddle</a></p>