From 1dbf61485811ac28d38bf16102de4e4e82c7f062 Mon Sep 17 00:00:00 2001 From: Aryo Date: Sun, 13 Oct 2024 07:00:23 +0200 Subject: [PATCH] Expand enum example tut1.md (#24268) I couldn't understand why there is "x" declaration. Comparison make it easier to understand to people not familiar to enums. --- doc/tut1.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/tut1.md b/doc/tut1.md index 2e83effa3b14e..3eaa1b1610c3d 100644 --- a/doc/tut1.md +++ b/doc/tut1.md @@ -1182,6 +1182,9 @@ at runtime by 0, the second by 1, and so on. For example: var x = south # `x` is of type `Direction`; its value is `south` echo x # prints "south" + + if x == Direction.south: + echo "It's south!" ``` All the comparison operators can be used with enumeration types.