I have doubt in following code snippet.
for(var i=0; i<5; i++){
http.request(option, function(res){
console.log(i)
});
}
This prints value of 'i' as 5, five times. Is there any way to make value of 'i' in sync with function(res) which can print 0,1,2,3,4