Tell us what’s happening:
What am why is there errors under the case words? this happens during the last couple of lessons.
**Your code so far**
function chainToSwitch(val) {
var answer = "";
// Only change code below this line
if (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;
}
chainToSwitch(7);
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15
I know its probably a syntax error, but I dont get what. I even looked at the answer from the hint section and its the same, I copied and pasted it but the little red lines were still there.
I strongly recommend against getting the the habit of copying solutions. Doing so typically leads to understanding less and less until you can only get the checkmarks by copying answers. This becomes a problem for the projects, as there are no posted solutions to copy.
Just woke up fixed it, I thought I already changed it before changing the other code. everything seems to be ok but I have a little red line under the semi colon for chainToSwitch(7); no other errors are showing up in the console, just the end bracket and the chainToSwitch thing
Lots of people “don’t usually do that” but find themselves checking and copying the answers more and more until they can’t do any challenges on their own. It’s worth being aware of the big risk.