Using Node.
Trying to avoid global vars, but I need to share a variable(integer) between two functions that are not nested. Both functions are declared directly under the global scope.
Is something like this considered a good practice for what I'm trying to accomplish? If not, is there a better pattern to follow?
function doStuffWithDataFromEventListener(){
var a = inner2().num;
}();
var fakeListener = function(){ //make believe event listener that is only called once.
var num = 7;
return {num: num};
};