I am trying in the for loop to access the value of the i with which the callback function uses.
How can I do this?
for (var i = 0; i < a.length; i
for (var i = 0; i < a.length; i++) { function createCallback(i) { return function(response) { // i want here to have the current "i" here } } calcRoute(fixedLocation, my_cities[i].address, createCallback(i)); }