Paracetamol.js

Explica este código JavaScript Dificultad: Básico const q = 1; switch (q) { case '1': answer = "one"; case 1: answer = 1; case 2: answer = "this is the one"; break; default: answer = "not working"; } console.log(answer); A. "1" B. 1 C. this is the one D. not working Respuesta en el primer comentario.

May 8, 2025 - 15:35
 0
Paracetamol.js

Explica este código JavaScript

Dificultad: Básico

const q = 1;
switch (q) {
  case '1':
    answer = "one";
  case 1:
    answer = 1;
  case 2:
    answer = "this is the one";
    break;
  default:
    answer = "not working";
}
console.log(answer);
  • A. "1"
  • B. 1
  • C. this is the one
  • D. not working

Respuesta en el primer comentario.