How to create a switch statement in JavaScript

Syntax
Last updated Dec 24, 2017
let key = "right";

switch (key) {
  case "right":
    console.log("Go right");
    break;

  case "left":
    console.log("Go left");
    break;
}
Go right