I have the following:
result = foobar(randInt, function(err, result){
})
console.log(result);
whereby the foobar
function gets a random response from an external api.
I can output the result if I write the code like this
result = foobar(randInt, function(err, result){
console.log(result);
})
and it outputs the result, but if I write it like this
result = foobar(randInt, function(err, result){
})
console.log(result);
I get undefined
How can I access the result of the function such that I can process it later
Like this for example result += ' accepted