I have a function foo which holds the bar. Is it possible to access bar from an external function with the code in its current state (ie - not changing anything inside foo).
From my understanding, this is not possible as bar is only visible for foo. My solution would be to create a get() that would extract bar.
var foo = function() {
var bar = {
a : 'a',
b : 'b'
};
};