We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c681720 commit 66e6d7bCopy full SHA for 66e6d7b
README.md
@@ -84,6 +84,46 @@ int add(int a, int b) {
84
(get_local $b)))
85
```
86
87
+### if...else statement
88
+
89
+There are two ways to express `if`...`else` statement
90
91
+```WebAssembly
92
+(get_local $condition)
93
+(if
94
+ (then
95
+ ;; statement(s)
96
+ )
97
+ (else
98
99
100
+)
101
+```
102
103
104
105
+ (get_local $condition)
106
107
108
109
110
111
112
113
114
115
+`if` can also return a result
116
117
118
+(if (result i32)
119
120
121
+ i32.const 4)
122
123
+ i32.const 5)
124
125
126
127
### Operators
128
| | i32 | i64 | f32 | f64 |
129
|:-:| --- | --- | --- | --- |
0 commit comments