Should myFunc = function(){} evaluate right away in Javascript?
<p>Leave a comment if I'm wrong: In my memory, I thought the difference between the two style of function creation:</p>

<pre><code>function myFunc(){};
</code></pre>

<p>and </p>

<pre><code>myFunc = function(){};
</code></pre>

<p>is the first evaluate right away, and the later waits for the function call.</p>

<p>so I got this code in <a href="http://snook.ca/archives/javascript/global_variable" rel="nofollow">this article</a> about global variable is attach to window object:</p>

<pre><code>function setGloabalVariable(){
  window.variable = '1';
}
</code></pre>

<p>after loading the page, why the variable still undefined?</p>
