Skip to content

Commit 59ee704

Browse files
committed
Fix for loop snippet
1 parent b8d0574 commit 59ee704

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

pages/docs/manual/latest/control-flow.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,14 @@ for(var i = startValueInclusive; i <= endValueInclusive; ++i){
112112
<CodeTab labels={["ReScript", "JS Output"]}>
113113

114114
```res example
115-
// prints: 1 2 3
115+
// prints: 1 2 3, one per line
116116
for x in 1 to 3 {
117117
Js.log(x)
118-
Js.log(" ")
119118
}
120119
```
121120
```js
122121
for(var x = 1; x <= 3; ++x){
123122
console.log(x);
124-
console.log(" ");
125123
}
126124
```
127125

@@ -147,16 +145,14 @@ for(var i = startValueInclusive; i >= endValueInclusive; --i){
147145
<CodeTab labels={["ReScript", "JS Output"]}>
148146

149147
```res example
150-
// prints: 3 2 1
148+
// prints: 3 2 1, one per line
151149
for x in 3 downto 1 {
152150
Js.log(x)
153-
Js.log(" ")
154151
}
155152
```
156153
```js
157154
for(var x = 3; x >= 1; --x){
158155
console.log(x);
159-
console.log(" ");
160156
}
161157
```
162158

pages/docs/manual/v8.0.0/control-flow.mdx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,20 @@ for(var i = startValueInclusive; i <= endValueInclusive; ++i){
137137
<CodeTab labels={["Reason (Old Syntax)", "ML (Older Syntax)", "JS Output"]}>
138138

139139
```re
140-
// prints: 1 2 3
140+
// prints: 1 2 3, one per line
141141
for (x in 1 to 3) {
142142
Js.log(x);
143-
Js.log(" ");
144143
};
145144
```
146145
```ml
147-
(* prints: 1 2 3 *)
146+
(* prints: 1 2 3, one per line *)
148147
for x = 1 to 3 do
149148
Js.log x;
150-
Js.log " "
151149
done
152150
```
153151
```js
154152
for(var x = 1; x <= 3; ++x){
155153
console.log(x);
156-
console.log(" ");
157154
}
158155
```
159156

@@ -184,23 +181,20 @@ for(var i = startValueInclusive; i >= endValueInclusive; --i){
184181
<CodeTab labels={["Reason (Old Syntax)", "ML (Older Syntax)", "JS Output"]}>
185182

186183
```re
187-
// prints: 3 2 1
184+
// prints: 3 2 1, one per line
188185
for (x in 3 downto 1) {
189186
Js.log(x);
190-
Js.log(" ");
191187
};
192188
```
193189
```ml
194-
(* prints: 3 2 1 ()
190+
(* prints: 3 2 1, one per line)
195191
for x = 3 downto 1 do
196192
Js.log x;
197-
Js.log " "
198193
done
199194
```
200195
```js
201196
for(var x = 3; x >= 1; --x){
202197
console.log(x);
203-
console.log(" ");
204198
}
205199
```
206200

0 commit comments

Comments
 (0)