Yet another Switch Statement Question

Yet another Switch Statement Question
0

#1

Hi guys, I tried to find someone on past forums that tried this assignment like I did, but couldn’t. What am I doing wrong?

function caseInSwitch(val) {
var answer = “”;
// Only change code below this line

switch (answer) {
case 1:
console.log(“alpha”);
break;
case 2:
console.log(“beta”);
break;
case 3:
console.log(“gamma”);
break;
case 4:
console.log(“delta”);
break;
}

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

// Change this value to test
caseInSwitch(1);


#2

Can you link us to the specific challenge you are working on?


#3

…did that work?


#4

It doesn’t seem like you’re changing the value of answer, you’re only console-logging it which isn’t what you’re asked to do.


#5

yep, that was it, thank you. I need to start re-reading propblems more.


#6

I’d also recommend reading the MDN Reference Page on Javascript Switches it’ll describe them in detail :slight_smile: