257 B
257 B
importance: 4
Rewrite "if" into "switch"
Rewrite the code below using a single switch
statement:
let a = +prompt('a?', '');
if (a == 0) {
alert( 0 );
}
if (a == 1) {
alert( 1 );
}
if (a == 2 || a == 3) {
alert( '2,3' );
}