What specific section or headline is this issue about?
Taking advantage of fall-through / Multi-Caso - Operações encadeadas
What information was incorrect, unhelpful, or incomplete?
The error just appears on the Portuguese (BR) version, the example Taking advantage of fall-through does not return the correct output.
var foo = 1;
var output = "Output: ";
switch (foo) {
case 10:
output += "Então ";
case 1:
output += "Qual ";
output += "É ";
case 2:
output += "O Seu ";
case 3:
output += "Nome";
case 4:
output += "?";
alert(output);
break;
case 5:
output += "!";
alert(output);
break;
default:
alert("Favor escolher um número de 0 à 6!");
}
Em Multi-Caso - Operações encadeadas, existe um erro no output e no valore de case a ser utilizado, não há coerência. Pode confundir pessoas novas!
foo é NaN ou não é 1, 2, 3, 4, 5 ou 10 / Favor escolher um número de 0 à 6!
What did you expect to see?
deveria:
foo é NaN ou não é 1, 2, 3, 4, 5 ou 0 / Favor escolher um número de 0 à 5!
ou:
foo é NaN ou não é 1, 2, 3, 4, 5 ou 10 / Favor escolher um número de 1 à 5 ou 10!
Do you have any supporting links, references, or citations?
The documentation in translated in english shows the expected example to be used.
MDN URL
https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Statements/switch
What specific section or headline is this issue about?
Taking advantage of fall-through / Multi-Caso - Operações encadeadas
What information was incorrect, unhelpful, or incomplete?
The error just appears on the Portuguese (BR) version, the example Taking advantage of fall-through does not return the correct output.
var foo = 1; var output = "Output: "; switch (foo) { case 10: output += "Então "; case 1: output += "Qual "; output += "É "; case 2: output += "O Seu "; case 3: output += "Nome"; case 4: output += "?"; alert(output); break; case 5: output += "!"; alert(output); break; default: alert("Favor escolher um número de 0 à 6!"); }
Em Multi-Caso - Operações encadeadas, existe um erro no output e no valore de case a ser utilizado, não há coerência. Pode confundir pessoas novas! foo é NaN ou não é 1, 2, 3, 4, 5 ou 10 / Favor escolher um número de 0 à 6!
What did you expect to see?
deveria: foo é NaN ou não é 1, 2, 3, 4, 5 ou 0 / Favor escolher um número de 0 à 5! ou: foo é NaN ou não é 1, 2, 3, 4, 5 ou 10 / Favor escolher um número de 1 à 5 ou 10!
Do you have any supporting links, references, or citations?
The documentation in translated in english shows the expected example to be used.
Do you have anything more you want to share?
No response
MDN metadata
Page report details
* Folder: `pt-br/web/javascript/reference/statements/switch` * MDN URL: https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Statements/switch * GitHub URL: https://github.com/mdn/translated-content/blob/main/files/pt-br/web/javascript/reference/statements/switch/index.md * Last commit: https://github.com/mdn/translated-content/commit/808b7d39103c946ca1b7dd5edbe7afd203c92efd * Document last modified: 2023-11-08T14:55:52.000Z