Switch Statement - "Unexpected token case"

Switch Statement - "Unexpected token case"
0.0 0

#1

I’m doing the JS tutorials, and I’ve got to the “Selecting from many options with Switch Statements”.

I have the code below, but it’s returning “SyntaxError: Unexpected token case”.

It is also doing the same with a CodePen, but I’m not sure what I’m doing wrong.

The wiki for this tutorial is less than useless, as it just copies the challenge.

function caseInSwitch(val) {
  var answer = "";
  // Only change code below this line
  case 1:
    answer = "alpha";
    break;
  case 2:
    answer = "beta";
    break;
  case 3:
    answer = "gamma";
    break;
  case 4:
    answer = "delta";
    break;
  // Only change code above this line  
  return answer;  
}

#2

Think I’ve got it…

I’m missing the switch code!!!