Challenge Waypoint: Selecting from many options with Switch Statements has an issue.
User Agent is: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36 OPR/34.0.2036.25.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function myTest(val) {
var answer = "";
// Only change code below this line
switch (val) {
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
myTest(1);
Please someone tell me why its not functioning
Issue does not describe a problem. Github issues are not for challenge help, please visit the Help Chat for challenge help and then file an issue if they confirm that what you are experiencing is a site bug.
same problem here can't figure out what i have to do
@ferraucchio Please use the help chat room for getting help with challenges. If you believe this challenge needs updated then please open a new issue.
I just found the problem and solved it, you need to change the function name!
@ferraucchio Great!
The problem with this challenge is the explanation doesn't describe how the variable in the original function ties to the switch statement. There is no psuedo code showing how the function ties in so there is no way for someone new to this statement to understand what the challenge is asking to do. I only figured this out by trying every possible variable combination until I got it to work, but this did nothing to tell me WHY it worked, I had to google multiple sites until I learned how it works.
This challenge should have an explanation describing how the variable in the function is tied to the switch statement and how the return statement is also tied in. This may seem trivial to someone who knows what to look for, but to a beginner the entire challenge is murky and confusing.