2023-07-29T14:37:10.png

var day = 3;
switch(day){
    case 0:
        alert("星期1");
        break;
    case 1:
        alert("星期2");
        break;
    case 2: 
        alert("星期3");
        break;
    case 3: 
        alert("星期4");
        break;
    case 4: 
        alert("星期5");
        break;
    case 5: 
        alert("星期6");
        break;
    default:
        alert("星期7");
};

2023-07-29T14:39:58.png

var day = 3;
switch(day > 0){
    case true:
        alert("是的,day大于0");
        break;
    default:
        alert("错误,day小于0");

};