Wednesday, 24 May 2017

How to synchronously call a function multiple times (different paramteres) in order and one by one

var a = 10;
for loop(var i=0;i<a;i++){
    call method A(i)

}
method A(i){
    //my code

    return anyValue;
  }

Want to execute method after getting returned value from first call and so on.Tried with Promises but still it executing Asynchronously.



via rohit7

No comments:

Post a Comment