Tried to pass the test with following code but it fail, Please advise

Tell us what’s happening:

It work on test run, but just cannot get through the test check
Is there any issue with the coding

Please advise
New to Javascrpit(thanks)

Your code so far


function caseInSwitch(val) {
var answer = ["alpha","beta","gamma","delta"];
// Only change code below this line
switch(val){
case 1:
console.log(answer[val - 1]);
break;
case 2:
console.log(answer[val - 1]);
break;
case 3:
console.log(answer[val - 1]);
break;
case 4:
console.log(answer[val - 1]);
break;
}


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

caseInSwitch(1);

Challenge: Selecting from Many Options with Switch Statements

Link to the challenge:

Write a switch statement which tests val and sets answer for the following conditions:

you need to set the var answer to the value specified in the conditions
Not console log the value

Oh… I see where is that coming from
Thanks for your reply
Regards