Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 274 Bytes

File metadata and controls

23 lines (16 loc) · 274 Bytes

importance: 4


Transforme o "if" num "switch"

Reescreva o código abaixo empregando uma única instrução switch:

let a = +prompt('a?', '');

if (a == 0) {
  alert( 0 );
}
if (a == 1) {
  alert( 1 );
}

if (a == 2 || a == 3) {
  alert( '2,3' );
}