I'm using this doc : http://www.w3schools.com/js/js_scope.asp as an exemple.
I'm trying to get var name = snoopdog, outside the main function.
function A(){
function B(){
name = "snoopdog";
}
//Show snoopdog
alert(name);
}
//Show nothing
alert(name);
Ok I tried to put the nested function inside a variable, still not working.
A()called?, WhereB()called?namevariable is notname, which refers towindow.nameproperty.)window.namecan only be a string, and it's the only variable except the storages that survives reloading.