0

I'm struggling accessing values that get returned via a nested inline callback function, from outside.

Below is a snipped of the code which I bound to. To be explicit I like to access all bbb results.

myfunction(){

    var allB = [];

    getFunctionA(para1, function (aaa, error) {
        for (var index = 0; index < aaa.length; ++index) {
            getFunctionB(para1, aaa[index].id, function (bbb, error) {
                allB = allB.concat(bbb);                    
            });
        }
    });


    //How to work with all bbb's 

}

Any idea how to access these values? allB = allB.concat(bbb); will not give me the values (allB is empty).

flor1an
  • 960
  • 3
  • 15
  • 33

0 Answers0