I am 100% sure there must be some simple answer but today I suck at googling. Question within the code.
async.waterfall([
function(callback){
callback(null, 'some value..');
}
],
function (err, result) {
// how do I get result outside of this block?
}
);
If I set a variable outside this block and try to assign “result” to it, it does not make out of the block because of the nature of JavaScript scopes..
Thanks!
Thanks everyone for your answers. What I’ve done – I’ve switched to a module called “step” instead. It lets me do the following:
Maybe I could have done something like this with async as well – I don’t know. But the above works just the way I wanted.