title: using node.js to parse multi-dimensional census data
body: <p>I am attempting to pull out individual rows and specific data from the census data using node.js JSON.parse.  </p>
  
  <pre><code>const http = require('http');
  
  function printStuff(statesInfo){
  
      const statesPopulations = `${statesInfo}  This is all states info`;
      console.log(statesPopulations);
  }
  
  
  const request = http.get(`http://api.census.gov/data/2013/acs5?get=NAME,B01001_001E&amp;for=state:*&amp;key=4c2f7253819e5491c78ff2c5ed541fe95943854c`,              
  
  response =&gt; {
  
      let body = "";
  
  
     console.log('Status Code:', response.statusCode);  
  
     response.on('data', data=&gt; {
         body += data.toString();
  
     });
  
     response.on('end', () =&gt; {
  
         const statePop = JSON.parse(body);
  
         const statesInfo = JSON.parse(body);
  
         printStuff(statesInfo);
  
  
     })
  });
  </code></pre>
  
  <p>Using console.log(body) the results show up as...</p>
  
  <blockquote>
    <p>NAME,B01001_001E,state,Alabama,4799277,01,Alaska,720316,02,Arizona,6479703,04,Arkansas,2933369,05,California,37659181,06,Colorado,51
    19329,08,Connecticut,3583561,09,Delaware.......</p>
  </blockquote>
  
  <p>if I use console.dir(body), the results show up as....</p>
  
  <blockquote>
    <p>[[NAME][B01001][state]
    ['Alabama', '4799927', '01'],
    [ 'Alaska', '720316', '02' ]] ....</p>
  </blockquote>
  
  <p>all the way down to Puerto Rico.  I am trying to pull specific things out but examples I've been using on Treehouse are set up all nice and neat where you can pull specifically labeled things out using nice things like profile.badges.length, but from what I can tell, none of these things are labelled.  I would like to be able to say, pull Virginia's info out of there, or Delaware.</p>