Skip to content

Commit

Permalink
Update pattern-matching.md
Browse files Browse the repository at this point in the history
fix broken |
  • Loading branch information
markknol authored Sep 20, 2024
1 parent 7a01829 commit 09b79c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions assets/content/cookbook/Beginner/pattern-matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ for (value in 0...10) {

### Or pattern

The `|`
operator can be used anywhere within patterns to describe multiple accepted patterns. If there is a captured variable in an or-pattern, it must appear in both its sub-patterns.
The | operator can be used anywhere within patterns to describe multiple accepted patterns. If there is a captured variable in an or-pattern, it must appear in both its sub-patterns.

Let's go on with the previous example and say that not only 2 and 4 are special, but 6 is too. You can switch on multiple cases like this:

Expand Down

0 comments on commit 09b79c8

Please sign in to comment.