dimanche 21 août 2016

How to access array in asyncTimes?Is that possible?

I have a for loop which has array of values once that iteration ends i need to pass the array values to async.Times with two callback,how to handle this kind of scenario in nodejs

example see the below code

    var date = 20;
    var myarray = [];
    for(i = 0; i < 5 ; i++){
        myarray[i] = date;
        date++;
    }
    async.times(n,function(){
       myfunction(n,function(err,date){
         next(err,date)
     },function(err,date){
    });

here date array should passed is that possible?

Aucun commentaire:

Enregistrer un commentaire