Comments in translated challenges break tests

You should not use any if statements anywhere in the editor.
Can you tell me what’s wrong with it please?

Il tuo codice fino ad ora

function chainToSwitch(val) {
var answer = "";
// Modifica il codice solo sotto questa riga
switch (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;

// Modifica il codice solo sopra questa riga
return answer;

  **Informazioni del tuo browser:**

Lo user agent è: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

Sfida: Sostituire le catene di If Else con Switch

Link alla sfida:

It looks like the tests for this challenge need to be revised, your code is correct, but the tests scan the code for the word if and find it in the comment:

// Modifica il codice solo sopra questa riga

You can pass the challenge if you delete those two comments.

1 Like

Hi @dsqyzn !

Welcome to the forum!

I will ask the other moderators what the protocol is for reporting bugs for the translated FCC challenges.

I already opened an issue:

Apologies if it’s in the wrong place because it’s a translated version.

1 Like

That’s fine. Thanks.

If it is in the wrong place then they will move it.

it’s an issue with the tests, github is perfectly fine

if the string needs to be changed they will let italian translation team know


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.