Title here
Summary here
You can use commas to separate multiple expressions in the same case
statement. We use the optional default
case in this example as well.
Switch
without an expression is an alternate way to express if/else logic. Here we also show how the case
expressions can be non-constants.
A type Switch
compares types instead of values. You can use this to discover the type of a value. In this example, we define a function whatAmI
that will print the type of its argument.
The output of these examples will be: