What is the difference between these snippets?
<p>New to javascript, I face many problems.</p>

<p>I read the javascript tutorial at w3cschools.com,
and there are many question marks on my head.</p>

<p>I do not understand what is the difference below:</p>

<pre><code>var name=something;

name=something;
</code></pre>

<p>The above two examples also giving something to a name, why 2 different ways?</p>

<pre><code>name=new Array();

name[0]=something0;

name[1]=something1;
</code></pre>

<p>is this same with switch?</p>

<p>//switch start</p>

<pre><code>var name=something();

switch(something)

{

case 1:

do something;

break;

case 2:

do something;

break;

default:

do something;

}
</code></pre>

<p>//if...else start</p>

<pre><code>var name=something();

if (condition) 

{

do something

};

else if (condition)

{

do something

};

else

{

do something

};
</code></pre>

<p>what is the different between switch case and else.if ?</p>

<p>i think both 2 is doing the same thing?match condition and then do something?</p>

<p>and the for Loops,while Loops and break Loops , </p>

<p>both 3 are doing the same thing,but 3 different ways.</p>

<p>can someone tell me what is the different between them?it make me confuse.</p>

<p>and please intro more tutorial for javascript.</p>

<p>many thanks here</p>
