📜  switch case js - Javascript 代码示例

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

代码示例5
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";
}