Replacing If Else Chains with Switch in js

Tell us what’s happening:

Your code so far

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

**Your browser information:**

Your Browser User Agent is: ```Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36```.

**Link to the challenge:**

You didn’t put anything in the “Tell us what’s happening” section. Please tell us what is going on and what steps you have tried to fix it.

This is the problem i’m having please help me to solve chanllenge

Your function is not returning answer, so it returns undefined by default.

I would first advise you to align your code for readability, whether it be yours, or for anyone else who is looking at your code.
From what I see, it seems you forgot the most important thing about this function. It is supposed to return a value. That is one of your mistakes.

Thanks i have solved the issue