Consider this contrived example
reqs = for url in urls
$.ajax
url: url
successs: (resp) =>
# here, url is always the last url,
# apparently because closure doesn't copy the captured locals
console.log "response for url: #{url}"
What is the best way to determine which url belong to which request in the success case?
Later, there is a call
$.when(reqs...).then (resps...) =>
console.log(resps)
Still, now way to know, because the order of resps
might differ from reqs
' order, right?