Skip to content

Commit 19efb17

Browse files
committed
ternary
1 parent 3634ed0 commit 19efb17

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

content/posts/odin-guide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ for i := 0; i < 10; i += 1 do foo()
118118

119119
## Ternary Operator
120120

121+
In Odin there are 3 types of ternary operator syntaxes:
122+
123+
```odin
124+
foo = condition ? x : y // runtime ternary
125+
foo = x if condition else y // runtime ternary
126+
foo = x when condition else y // compile time ternary
127+
```
128+
121129
## References
122130

123131
## Memory

0 commit comments

Comments
 (0)