Good Ol' Switch Statements
Switch statements have been around since the early days of programming. In fact, the structure is identical across C-style languages.
switch (variable) {
case 1:
// Some code here
break;
case 2:
// Some code here
...
blog.dougdawson.info2 min read