When-Cases
When-Case syntax
A when-case is equivalent to a switch case, except:
when-cases are expressions, not statements
The
default
case is requiredNew scopes cannot be used on the left side of the arrow. Only expressions can.
Working Example
Last updated