- 1
Is this a valid way to write the switch statement? var day; switch (day=3) { case 1: ...
2 Antworten
0
yes it is and why do you think it will not work
var day;
switch(day=3)
{
case 1: document.write("google");
break;
case 3: document.write("aditya");
break;
}
output is
aditya
0
If you fix a value of a day variable, where is the need to use a case statement ?