1 parent 1dfbac9 commit ea4d3b3Copy full SHA for ea4d3b3
1 file changed
content/posts/jai-guide.md
@@ -93,7 +93,15 @@ for a: arr {
93
94
## Ternary Operator
95
96
-todo
+jai uses `ifx` as its ternary operator, the syntax is `ifx condition then value else value`, but `then` is optional:
97
+
98
+```jai
99
+a := 0;
100
+b := 100;
101
102
+c := ifx a > b 10 else 1000; // without explicit then
103
+d := ifx a > b then 10 else 1000; // with explicit then
104
+```
105
106
## References
107
0 commit comments