js pass object to callback function : <p>I would like to reference the item object in the geocoder callback function.
Item always refers to the state of the last $each iteration, if I use the code below. I assume this is because the callback is run after the $each loop finishes. I would therefore need to pass the item object to the geocoder. How can I do that?</p>

<pre><code> $.each(results.data, function(index) {
        var item = results.data[index];
        geocoder.geocode( { 'address': address}, function(results, status) {
            item.lat = results[0].geometry.location.lat();
            item.lng = results[0].geometry.location.lng();
        });
    });
</code></pre>
