title: Access array in array in javascript
body: <p>I am getting a JSON reply, like following:</p>
  
  <pre><code>[{
    "order_id": "12",
    "customer": "user user",
    "status": "Pending",
    "date_added": "02\/09\/2012",
    "total": "$500.00",
    "action": [{
      "text": "View",
      "href": "http:\/\/localhost\/oc\/admin\/index.php?route=sale\/order\/info&amp;amp;token=92a80574e5fcbf3e2d021404cfaae1a4&amp;amp;order_id=12"
    }]
  }]
  </code></pre>
  
  <p>have a look on action key, it's value is again an array. I am trying to get action key values by following code but it is showing undefined to me</p>
  
  <pre><code>function (data) {
    if (data) {
      for (var i = 0; i &lt; data.length; i++) {
        $('div.dashboard-content table.list tbody tr:first').before(
          '&lt;tr id="' + 
          data[i]['order_id'] + 
          '"&gt;&lt;td class="right"&gt;' + 
          data[i]['order_id'] + 
          '&lt;/td&gt;&lt;td class="left"&gt;' + 
          data[i]['customer'] + 
          '&lt;/td&gt;&lt;td class="left"&gt;' + 
          data[i]['status'] + 
          '&lt;/td&gt;&lt;td class="left"&gt;' + 
          data[i]['date_added'] + 
          '&lt;/td&gt;&lt;td class="right"&gt;' + 
          data[i]['total'] + 
          '&lt;/td&gt;&lt;td class="right"&gt; [&lt;a href="' + 
          data[i]['action']['href'] + '"&gt;' + 
          data[i]['action']['text'] + 
          '&lt;/a&gt;]&lt;/td&gt;&lt;/tr&gt;'
        );
      }
    }
  }
  </code></pre>
  
  <p>Can somebody help me.? 
  Thanks in advance.</p>