This is regarding javascript closures working. I have a function inside another and I want to access this outside of the outer function. is it possible since it written here that u can achieve closure with this http://www.w3schools.com/js/js_function_closures.asp JavaScript Nested Functions All functions have access to the global scope.
In fact, in JavaScript, all functions have access to the scope "above" them.
JavaScript supports nested functions. Nested functions have access to the scope "above" them.
In this example, the inner function plus() has access to the counter variable in the parent function:
Example
function add() {
var counter = 0;`enter code here`
function plus() {counter += 1;}
plus();
return counter;
}
I am trying to acess plus() from outside