Skip to content

Commit 293c9b7

Browse files
authored
👾 smth
1 parent 2efe0dc commit 293c9b7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ for (i = 0; i < 3; i++) { // use an existing variable
162162
163163
alert(i); // 3, visible, because declared outside of the loop
164164
```
165-
166165
````
167166

168-
169167
### Skipping parts
170168

171169
Any part of `for` can be skipped.
@@ -286,7 +284,6 @@ if (i > 5) {
286284
287285
...and rewrite it using a question mark:
288286
289-
290287
```js no-beautify
291288
(i > 5) ? alert(i) : *!*continue*/!*; // continue isn't allowed here
292289
```
@@ -321,6 +318,7 @@ We need a way to stop the process if the user cancels the input.
321318
The ordinary `break` after `input` would only break the inner loop. That's not sufficient -- labels, come to the rescue!
322319

323320
A *label* is an identifier with a colon before a loop:
321+
324322
```js
325323
labelName: for (...) {
326324
...
@@ -362,6 +360,7 @@ The `continue` directive can also be used with a label. In this case, code execu
362360
Labels do not allow us to jump into an arbitrary place in the code.
363361
364362
For example, it is impossible to do this:
363+
365364
```js
366365
break label; // jump to the label below (doesn't work)
367366

0 commit comments

Comments
 (0)