Non-local variable: Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
{{see also|Nested function#Implementation{{!}}Nested function: Implementation|Man or boy test}}
m Nested functions: Typo fixing, replaced: the the → the using AWB
Line 14:
</source>
 
In Javascript, the locality of a variable is determined by the the closest <code>var</code> statement for this variable. In the following example, <code>x</code> is local to <code>outer</code> as it contains a <code> var x</code> statement, while <code>inner</code> doesn't:
<source lang=javascript>
function outer(){