title: Google maps Geocode results undefined
body: <p>So I am trying to geocode an address from google maps but when I try to access the results it says the array containing the results are undefined. I've have done the exact opposite of this with looking up an address from coordinates, granted that was in PHP, I'm not sure why this isn't working. I would like to just parse through the JSON to get to the data I want (The Lat and long), but since I am unable to do that, I have done a work around and just did JSON.stringify and locate the Lat &amp; long via <code>str.locate("lat")</code>. </p>
  
  <p>However, When I parse the json response from google maps I get this</p>
  
  <pre><code>    { results: 
          [ { address_components: [Object],
          formatted_address: '2985 NW Moda Way, Hillsboro, OR 97124, USA',
          geometry: [Object],
          place_id: 'ChIJt-G-MmcPlVQROzDAlEVj1nA',
          types: [Object] } ],
          status: 'OK' 
       }
  </code></pre>
  
  <p>Where the object inside the geometry is what I want, to get this I am using the request library from node.js. And I am console logging the <code>JSON.parse(response.body);</code> to get the results array but trying to get to the results object via </p>
  
  <p><code>JSON.stringify(response.body.results[2]);</code> results in 
  <code>TypeError: Cannot read property '2' of undefined
  </code></p>
  
  <p>Edit: Code I am using request for google maps API</p>
  
  <pre><code> request('https://maps.googleapis.com/maps/api/geocode/json?address=' + address + '+' + parsedStreet + '&amp;key=' + key, function(err, response) {
       if (err)
          console.log("holy shit error");
      console.log(JSON.parse(response.body.results));
  </code></pre>
  
  <p>which returns </p>
  
  <p><code>undefined
  ^ SyntaxError: Unexpected token u in JSON at position 0</code></p>
  
  <p>address and parsedStreet are address values that I am reading from a file to convert into coordinates</p>