JavaScript closures issue
<p>Why this doesn't fire:</p>

<pre><code>var counter = function () {

    return function() {
        alert('Fire!');
    }
}

counter(); 
</code></pre>

<p>but this does:</p>

<pre><code>var counter = function () {

    return function() {
        alert('Fire!');
    }
}

var test = counter(); 
test();
</code></pre>

<p>It seems like assigning function to a variable makes difference but why?</p>
