I'm understanding "Scope" I found this code, but Im wondering how can I execute the "inner" function, I tried like this:
outer().inner();
but doesn't works
/* global scope */
var local = true;
var global = true;
function outer() {
/* local scope */
var local = true;
var global = false;
/* nearest scope = outer */
local = !global;
console.log("Local: "+local);
console.log("Global: "+Global);
function inner() {
/* nearest scope = outer */
local = false;
global = false;
/* nearest scope = undefined */
/* defaults to defining a global */
public = global;
}
}