I decided to create a switch statement on Snap! Download Block
var i = "a";
switch (i) {
case "a":
case "b":
return "A";
case "c":
case "d":
return "C";
case "e":
case "f":
return "E";
default:
return "-";
}
btw, it's better if you just share a project with it in it, that way the user can test out the block without downloading it.
bh
October 31, 2020, 10:10pm
3
Cool! I love making control structures in Snap! .
I'm grinning about how in the equivalent code in JS or Python or whatever that is, you felt the need to put break
statements after the return
statements. Force of habit?
sombrero:
return "A";
break;
Unreachable break after return statement
I'm litarally saying the same thing as
Is there an alternative to this? The download link no longer works.