Javascript

  • Evaluates an expression and executes a block of code depending on a matching case label.
javascript
var day = "Monday"; switch (day) { case "Monday": console.log("It's Monday!"); break; case "Tuesday": console.log("It's Tuesday!"); break; default: console.log("It's not Monday or Tuesday."); }

Thanks for learning