I use the following code
request(firstparams, function () {
var secondparams = {
// ******
};
request(secondparams, function () {
for (i=0; i<3; i++) {
var thirdparams = {
// ******
};
request(thirdparams, function () {
console.log('foo');
});
}
console.log('bar');
});
});
and want to get the result like:
foo
foo
foo
bar
but the result is:
bar
foo
foo
foo
Sorry for my poor English, if there is something ambiguity,I would try my best to explain. Thanks a lot ^ ^