关于case值:case的值是什么类型的,如果case值与myweek的值仅仅是类型不一样,能够匹配吗?
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>switch</title> <script type="text/JavaScript"> var myweek = prompt("日程安排:");//myweek表示星期几变量 switch(myweek) { case 1: case 2: document.write("学习理念知识"); break; case 3: case 4: document.write("到企业实践"); break; case 5: document.write("总结经验"); case 6: case 7: document.write("周六、日休息和娱乐"); break; default:break; } </script> </head> <body> </body> </html>
case的值是什么类型的,如果case值与myweek的值的类型不一样,能够匹配吗?还有这里弹出窗口输入数值后,好像没啥反应了?大神们能帮忙看看吗?