Why the alert doesn't work?
<p>I want to know what's the difference when declare a variable whether using <code>var</code>. i used the following code:</p>

<pre><code>&lt;body&gt;
    &lt;h1&gt;New Web Project Page&lt;/h1&gt;
    &lt;script type="text/javascript"&gt;
        function test(){
            a = "hello";
            var b="world";
        }
        alert(a);
            alert(b);


    &lt;/script&gt;
&lt;/body&gt;
</code></pre>

<p>Why the alert doesn't work and what's the difference when declare a variable whether using <code>var</code> in javascript.</p>
