Switch

WMA link


Switch[expr, $pattern_1$, $value_1$, $pattern_2$, $value_2$, ...]

yields the first value for which expr matches the corresponding pattern.

Notice that Switch evaluates each pattern before it against expr, stopping after the first match:

Return
Throw