What are non-switch "case"s for?

Sometimes I see code with “case” outside of a switch, like “if case” or “guard case”. Sometimes a “let” is involved. What do they mean? I still haven’t figured them out, let along what difference do they make over a regular “if” or “guard.”

2 Likes

Here is a nice article discussing if case and other pattern matching:

4 Likes