📜  javascript switch 语句 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:00.738000             🧑  作者: Mango

代码示例6
switch (new Date().getDay()) {      // input is current day
case 6:                         // if (day == 6)
    text = "Saturday";          
    break;
case 0:                         // if (day == 0)
    text = "Sunday";
    break;
default:                        // else...
    text = "Whatever";
}