16
rated 0 times
[
18]
[
2]
/ answers: 1 / hits: 6183
/ 10 Years ago, thu, february 20, 2014, 12:00:00
I want to call a function after an asynchronous for loop iterating through values of an Javascript object finishes executing. I have the following code
for (course in courses) {
var url = '...' + courses[course];
request(url, (function (course) {
return function (err, resp, body) {
$ = cheerio.load(body);
//Some code for which I use object values
};
})(course));
}
More From » ajax