📜  javascript代码示例中的switch语句

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

代码示例3
switch ("oboe") {
  case "trumpet":
    console.log("I play the trumpet");
    break;
  case "flute":
    console.log("I play the flute");
    break;
  case "oboe":
    console.log("I play the oboe");
    break;
  default:
    console.log("I don't play an instrument. Sorry");
    break;
}