Skip to content

Commit

Permalink
update: when content about if-else-if
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahhaggarty committed Nov 6, 2024
1 parent 93f70ee commit e87cf18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/topics/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ fun hasPrefix(x: Any) = when(x) {
```

You can use `when` as a replacement for an `if`-`else` `if` chain.
If there's no subject, the branch conditions are simply boolean expressions, and a branch is run when its condition is true:
If there's no subject, the branch conditions are simply boolean expressions. The first branch with a `true` condition runs:

```kotlin
when {
Expand Down

0 comments on commit e87cf18

Please sign in to comment.