I am calling a function within another function (inner function), and I need the result of the inner function to the out function.
Example:
var value;
database.query1(param1, param2, function(err, outerResults) {
if (outerResults == null) {
database.query2(params1, params2, function(err, innerResults) {
value = innerResults;
});
console.info(value); // I am not able to get the value of this innerResults outside the function
}
});