103
rated 0 times
[
110]
[
7]
/ answers: 1 / hits: 21376
/ 8 Years ago, sun, february 7, 2016, 12:00:00
Is async.each working as asynchronous array iterating?
Is async.eachSeries working as synchronous array iterating?(it waits response actually)
I'm asking these because both have callbacks but async.each works like asynchronous array iterating for ex:
//This is traditional way to iterate an array with callback functions in node.js
//Is this same with async.each ? i want to know it actually.
for (var i = 0; i < data.length; i++) {
(function (i) {
request(data[i],function(body){
console.log(body)
});
})(i);
//if this codes and async.each are doing same things ,
//i know that async gives me an aert when all finished thats the difference.
More From » node.js