How to create a switch statement in JavaScript

Syntax
By Jad Joubran · 
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
switch on MDN