Soluzioni "alternative" in "javascript-algorithms-and-data-structures"

Buongiorno,

Solo per segnalare che il listato di seguito:

// --------------------------------------
function caseInSwitch(val) {

  • let answer = “”;*
  • // Only change code below this line*
  • answer=[“alpha”,“beta”,“gamma”,“delta”]*
  • answer=answer[val*1-1] *
  • for(;;)break*
  • for(;;)break*
  • for(;;)break*
  • // Only change code above this line*
  • return answer;*
    }
    caseInSwitch(1);
    //-----------------------------------

nello step “Selezionare tra molte opzioni con le istruzioni Switch” è considerato una soluzione corretta.

Saluti.

sinceramente, considerando quanto lontano dall’esercizio questo codice è, non so se ne vale la pena.

Ma, se vuoi

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

E also

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).