Nested function scope variable
<p>I'm using this doc : <a href="http://www.w3schools.com/js/js_scope.asp" rel="nofollow">http://www.w3schools.com/js/js_scope.asp</a> as an exemple.</p>

<p>I'm trying to get var name = snoopdog, outside the main function.</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function A(){
  function B(){
    name = "snoopdog";  
  }
  //Show snoopdog
  alert(name);
}

//Show nothing
alert(name);</code></pre>
</div>
</div>
</p>

<p>Ok I tried to put the nested function inside a variable, still not working. </p>