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.
This commit is contained in:
Aryo
2024-10-13 07:00:23 +02:00
committed by GitHub
parent 2f7586c066
commit 1dbf614858

View File

@@ -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.