Selecting from many options with Switch Statements, tell me I'am wrong- help!

Tell us what’s happening:
Why is it saying that the task is not fullfilled? I did what it wanted from me.

Your code so far

function caseInSwitch(val) {
  var answer = "1";
  // Only change code below this line
  switch (answer) {
      case "1":
      case "2":
      case "3":
      case "4":
  // Only change code above this line  
  return answer;  

// Change this value to test

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0.

Link to the challenge:

that functions returning the value from variable answer

you initialized answer with the value of ‘1’, and I believe that challenge wants you to assign the answer when the val is 1,2,3 or 4 to an ‘alpha’, ‘beta’, ‘gamma’ or ‘delta’ respectively before returning it ( you already return the answer at the end of the function return answer). so just need to assign the var answer to the corresponding string.

example of assignment :
answer = "some string"

hope this helps

1 Like