Switch vs if else chains issue

function chainToSwitch(val) {
  var answer = "";
  // Only change code below this line
  
  switch (val) {
    case "bob":
    return answer = "Marley";
    break;
    case 42:
    return answer ="The Answer"; 
    break;
    case 1: 
    return answer = "There is no #1";
    break;
    case 99: 
    return answer = "Missed me by this much!";
    break;
    case 7:
    return answer = "Ate Nine";
    break;
    default:
  }
  
  // Only change code above this line  
  return answer;  
}

// Change this value to test
chainToSwitch(bob);

Error Message: For such a solution, bob case is not defined. Not sure what is the error.

If I use the other solution I tried

function chainToSwitch(val) {
  var answer = "";
  // Only change code below this line
  
  switch (val) {
    case 1:
    return answer = "Marley";
    break;
    case 2:
    return answer ="The Answer"; 
    break;
    case 3: 
    return answer = "There is no #1";
    break;
    case 4: 
    return answer = "Missed me by this much!";
    break;
    case 5:
    return answer = "Ate Nine";
    break;
    case 6: 
    return answer = "John"
    break;
    case 7:
    return answer = "56"
    break;

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

// Change this value to test
chainToSwitch(bob);

Error Message: Bob is still not defined.

Can any JS developer explain what the problem is?

Noted with thanks for the hints. Thanks for sharing the tip of how to make the readability of source codes.

Upon altering and changing the code, without return answer for each of the cases.

The error message shows maximum call stack.

function chainToSwitch(val) {
  var answer = "";
  // Only change code below this line
 switch (val) { 
case "bob":
answer ="Marley";
break;
case 42:
answer = "The Answer";
break;
case 1:
answer = "There is no #1";
break;
case 99:
answer= "Missed me by this much";
break;
case 7:
answer="Ate Nine";
break;
 }

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

// Change this value to test
chainToSwitch(7);

Yes I am using google chrome as my browser! I forgot the “!” which caused the code to change. I have checked my code and have updated accordingly prior to your checking and have passed the test! Many Thanks!