var app = (function(){
var foo = 'x';
var bar = function (){
...
};
var xx = function () {
bar();
}
return {
xx:xx
}
})();
since the function is a Immediately-Invoked Function Expression (IIFE) the app var is assigned the returning object literal. But in what way are the private members returned? Is the member foo not present in app since its not referenced in any public method? How is the reference to bar stored in the app variable?