Skip to content

Commit ad4b698

Browse files
authored
Merge pull request #84 from IanWitham/patch-5
Typo and syntax fixes
2 parents 323100f + 16a3cd4 commit ad4b698

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

1-js/02-first-steps/12-while-for/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ if (i < 3) { alert(i); i++ }
142142
```
143143

144144
````smart header="Inline variable declaration"
145-
Here the "counter" variable `i` is declared right in the loop. That's called an "inline" variable declaration. Such variable is visible only inside the loop.
145+
Here the "counter" variable `i` is declared right in the loop. That's called an "inline" variable declaration. Such variables are visible only inside the loop.
146146
147147
```js run
148148
for (*!*let*/!* i = 0; i < 3; i++) {
@@ -202,15 +202,15 @@ for (;;) {
202202
}
203203
```
204204

205-
Please note that the two `for` semicolons `;` must present, otherwise it would be a syntax error.
205+
Please note that the two `for` semicolons `;` must be present, otherwise it would be a syntax error.
206206

207207
## Breaking the loop
208208

209209
Normally the loop exits when the condition becomes falsy.
210210

211211
But we can force the exit at any moment. There's a special `break` directive for that.
212212

213-
For example, this code below asks user for numbers and breaks if no number entered:
213+
For example, the loop below asks the user for a series of numbers, but "breaks" when no number is entered:
214214

215215
```js
216216
let sum = 0;
@@ -353,7 +353,7 @@ In the code above `break outer` looks upwards for the label named `outer` and br
353353

354354
So the control goes straight from `(*)` to `alert('Done!')`.
355355

356-
We can also move a label into the separate string:
356+
We can also move the label onto a separate line:
357357

358358
```js no-beautify
359359
outer:

0 commit comments

Comments
 (0)