summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStefan Lobbenmeier <stefan.lobbenmeier@objego.de>2023-08-25 05:55:03 +0200
committerGitHub <noreply@github.com>2023-08-25 11:55:03 +0800
commita0736c7a174b9748f4695936bf14152f05e06fd5 (patch)
tree65826c3351b3aa6b669522bf7a1239d7556d1143
parent63a2c260297e7e00ccd2c893b341db45e3d53a71 (diff)
When is not a function, but an expression (#4603)
https://kotlinlang.org/docs/control-flow.html#when-expression
-rw-r--r--kotlin.html.markdown2
1 files changed, 1 insertions, 1 deletions
diff --git a/kotlin.html.markdown b/kotlin.html.markdown
index 12008074..6ca2dcf2 100644
--- a/kotlin.html.markdown
+++ b/kotlin.html.markdown
@@ -297,7 +297,7 @@ fun helloWorld(val name : String) {
else -> println("none of the above")
}
- // "when" can be used as a function that returns a value.
+ // "when" can be used as an expression that returns a value.
var result = when (i) {
0, 21 -> "0 or 21"
in 1..20 -> "in the range 1 to 20"