title: async calls to google service using javascript
body: <p>I have one array </p>
  
  <pre><code>SchoolAddress[0] = Abelsvej 98, 4100, Ringsted;
  SchoolAddress[1] = Prstevej 19, 4100, Ringsted;
  SchoolAddress[2] = Haraldsvej 77, 4100, Ringsted;
  </code></pre>
  
  <p>I have to get latitude &amp; longitude for this address.</p>
  
  <p>I am using google geocoder for this.</p>
  
  <pre><code>for (var i = 0; i &lt; schools.length; i++) 
  {
      var address = schools[i][1];
      var geocoder = new google.maps.Geocoder();
      geocoder.geocode({ 'address': address }, function (results, status) 
      {
          var location = results[0].geometry.location;
          schoolslat[i] = location.lat() + ', ' + location.lng();
      });
  } 
  </code></pre>
  
  <p>Here what happens is as call takes some time, the values coming from call do not go to proper schoolslat[i].</p>