New to javascript, I face many problems.
I read the javascript tutorial at w3cschools.com, and there are many question marks on my head.
I do not understand what is the difference below:
var name=something;
name=something;
The above two examples also giving something to a name, why 2 different ways?
name=new Array();
name[0]=something0;
name[1]=something1;
is this same with switch?
//switch start
var name=something();
switch(something)
{
case 1:
do something;
break;
case 2:
do something;
break;
default:
do something;
}
//if...else start
var name=something();
if (condition)
{
do something
};
else if (condition)
{
do something
};
else
{
do something
};
what is the different between switch case and else.if ?
i think both 2 is doing the same thing?match condition and then do something?
and the for Loops,while Loops and break Loops ,
both 3 are doing the same thing,but 3 different ways.
can someone tell me what is the different between them?it make me confuse.
and please intro more tutorial for javascript.
many thanks here