From e87cf18d793af24c9e0153cd063b7588350f6fed Mon Sep 17 00:00:00 2001 From: Sarah Haggarty Date: Wed, 6 Nov 2024 14:43:05 +0100 Subject: [PATCH] update: when content about if-else-if --- docs/topics/control-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/control-flow.md b/docs/topics/control-flow.md index 000dca33fa6..fff218112c4 100644 --- a/docs/topics/control-flow.md +++ b/docs/topics/control-flow.md @@ -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 {