I have a bunch of nested functions, some of which return values that I would like to get out to the global scope. What is the best way to do this? This is my example:
function mainFunction(){
function A(){
//somecode
return valueA;
}
function B(){
//somecode
return {valueB1: valueB1, valueB2: "N/A"};
}
return {Avalue: A(), Bvalue: B().valueB1}
}