Example:
let boo = {
'foo' : function() {
let bar = 94;
}
}
I want to access bar variable outside function scope. Can anyone help me please?
Example:
let boo = {
'foo' : function() {
let bar = 94;
}
}
I want to access bar variable outside function scope. Can anyone help me please?
You can't access it as you have it in your code. That's how closures work by design. If you want to "see inside" the closure, provide some sort of "getter" function.