Referencing global variables in local scopes
<p>I would like to know memory leak in the below mentioned code. Does JavaScript do automatic garbage collection.</p>

<pre><code>var aGlobalObject = SomeGlobalObject; 
function myFunction() {
   var localVar = aGlobalObject;
}
</code></pre>

<p>Do I have to clear the memory as given below.</p>

<pre><code>var aGlobalObject = SomeGlobalObject; 
function myFunction() {
   var localVar = aGlobalObject;
   localVar = null;// or delete localVar
}
</code></pre>

<p>Thanks</p>
