请参阅下面的JavaScript中的switch语句,同样不起作用。请告知错误。
function main(arg1){
switch(arg1) {
case 'Jatin':
alert('This is Jatin');
break;
case 'Vivek':
alert('This is Vivek');
break;
case 'Vikas':
alert('This is Vikas');
break;
default:
alert('The name is not found');
};
main("Jatin");
答案 0 :(得分:0)
function main(arg1){
switch(arg1) {
case 'Jatin':
alert('This is Jatin');
break;
case 'Vivek':
alert('This is Vivek');
break;
case 'Vikas':
alert('This is Vikas');
break;
default:
alert('The name is not found');
} // no semi colon
} // closing brace
main("Jatin");