title: Efficient way to iterate through JSON response in JavaScript
body: <p>I have been reviewing the Khan Academy API (<a href="https://github.com/Khan/khan-api/wiki/Khan-Academy-API" rel="nofollow">https://github.com/Khan/khan-api/wiki/Khan-Academy-API</a>) and it identifies <a href="http://www.khanacademy.org/api/v1/topictree" rel="nofollow">http://www.khanacademy.org/api/v1/topictree</a> as the main API call.  I am using the following code to get a list of categories that represents the same menu structure on the actual website.</p>
  
  <pre><code>$(document).ready(function() {
  $.ajax({
  url: "http://www.khanacademy.org/api/v1/topictree",
  type: 'GET',
  dataType: "json",
  success: function(data) {                               
          for(var i = 0; i &lt; data.children.length; i++)
          {                       
              //$("#mylist").append("&lt;a href='http://myurl.com/Courses.html?CatId="+data.children[i].id+"'&gt;"+data.children[i].title+"&lt;/a&gt;&lt;br/&gt;");             
          }        
      }
    }); 
  });
  </code></pre>
  
  <p>I am not able to find the most efficient way to get at the children of a categroy and then print out the value of its url and name.  Everytime I try to call the API my browser hangs since the JSON response is about 40mb of data.  The GITHUB site at <a href="https://github.com/Khan/khan-api/wiki/Khan-Academy-API" rel="nofollow">https://github.com/Khan/khan-api/wiki/Khan-Academy-API</a> mentions that you should filter by topic but the examples provided are not at the root level so I am unable to determine the relationship of the partent to child.  </p>
  
  <p>Can someone help me find an efficient way to parse the JSON response and get the children value for each top level category?  Also, what tools do you use to iterate through API calls and JSON responses before committing any code?  Thank you for any help you can provide!</p>