Skip to content

Commit d3f5a59

Browse files
committed
closes #2536
1 parent 211e130 commit d3f5a59

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,18 @@ break label; // jump to the label below (doesn't work)
368368
label: for (...)
369369
```
370370
371-
A call to `continue` is only possible from inside the loop.
371+
A `break` directive must be inside a code block. Technically, any labelled code block will do, e.g.:
372+
```js
373+
label: {
374+
// ...
375+
break label; // works
376+
// ...
377+
}
378+
```
379+
380+
...Although, 99.9% of the time `break` used is inside loops, as we've seen in the examples above.
372381
373-
The `break` directive may be placed before code blocks too, as `label: { ... }`, but it's almost never used like that. And it also works only inside-out.
382+
A `continue` is only possible from inside a loop.
374383
````
375384

376385
## Summary

0 commit comments

Comments
 (0)