📜  javascript switch 语句多例 - Javascript代码示例

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

代码示例1
//javascript multiple case switch statement
var color = "yellow";
var darkOrLight="";
switch(color) {
    case "yellow":case "pink":case "orange":
        darkOrLight = "Light";
        break;
    case "blue":case "purple":case "brown":
        darkOrLight = "Dark";
        break;
    default:
        darkOrLight = "Unknown";
}

//darkOrLight="Light"