title: How to print json data.
body: <p>I have a json output array like this </p>
  
  <pre><code>{
     "data": [
        {
           "name": "Ben Thorpe",
           "id": "XXXXXXXXXXX"
        },
        {
           "name": "Francis David",
           "id": "XXXXXXXXXXX"
        },
  }
  </code></pre>
  
  <p>I want to loop through it and print out the all the names using javascript. I want to be able to do this.</p>
  
  <pre><code>for(i=0;i&lt;length;i++){
        var result += response.data[i].name + ', ';
  }
  </code></pre>
  
  <p>But I am unable to find the length of the json object using javascript.</p>