Is there any kind of "end if" in java script? Is there a way if putting an if into an if? Is there anything like "Cases" from basic, in Java Script?
Printable View
Is there any kind of "end if" in java script? Is there a way if putting an if into an if? Is there anything like "Cases" from basic, in Java Script?
Yes, you can put IF inside of IF, and you can use Case statement also. Check this http://msdn.microsoft.com/scripting/default.htm
The JavaScript version of the Select Case is:
switch(n){
case 1: //n=1
//Do something
break;
case 2: //n=2
//Do something
break;
default:
//Do something
break;
}