Basic JavaScript - Selecting from Many Options with Switch Statements what is wrong show

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

  function caseInSwitch(val) {
  let answer = "";
  // Only change code below this line
caseInSwitch(1)(val){
case "alpha":
console.log("The val is alpha");
break;
case "beta":
console.log("The val is beta");
break;
case "gamma":
console.log("The val is gamma");
break;
case "delta":
console.log("The val is delta")
break;
}


  // Only change code above this line
  return answer;
}

caseInSwitch(1);

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 6.0; BGO-DL09) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.74 Mobile Safari/537.36

Challenge: Basic JavaScript - Selecting from Many Options with Switch Statements

Link to the challenge:

It helps to put your question here.


It helps to use standard formatting

function caseInSwitch(val) {
  let answer = "";
  // Only change code below this line
  caseInSwitch(1) (val) {
    case "alpha":
    console.log("The val is alpha");
    break;
  case "beta":
    console.log("The val is beta");
    break;
  case "gamma":
    console.log("The val is gamma");
    break;
  case "delta":
    console.log("The val is delta");
    break;
  }

  // Only change code above this line
  return answer;
}

I don’t understand what this piece is. It doesn’t look like the example.

The challenge doesn’t want you use use console.log. You need to change the value of answer.

The cases are the values val is matching, which are 1, 2, 3, or 4.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.