title: Parsing JSON in Javascript
body: <p>I have the following code:</p>
  
  <pre><code>var addressInfo = [];
  for(var x in address_components_root){
      addressInfo.push(address_components_root[x].long_name+"|||"+address_components_root[x].types[0]);
  }
  
  
  for(var d in addressInfo) {
      addressI = addressInfo[d].split("|||");
      if (addressI[1]=="street_number") {
          window.alert("street");
      }
  }
  </code></pre>
  
  <p><code>address_components_root</code> is a JSON encoded response as found at <a href="http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&amp;sensor=false" rel="nofollow">http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&amp;sensor=false</a></p>
  
  <p>How would I parse this json correctly like for example using <code>eval</code> so I don;t need to manually assign all the data?</p>