I was wondering if there is any way to access variables trapped by closure in a function from outside the function; e.g. if I have:
A = function(b) {
var c = function() {//some code using b};
foo: function() {
//do things with c;
}
}
is there any way to get access to c
in an instance of A
. Something like:
var a_inst = new A(123);
var my_c = somejavascriptmagic(a_inst);