From d3f5a59d0629af2997080224993e2c429bc264f5 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Fri, 26 Mar 2021 08:38:34 +0300 Subject: [PATCH] closes #2536 --- 1-js/02-first-steps/13-while-for/article.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/13-while-for/article.md b/1-js/02-first-steps/13-while-for/article.md index 56a59850..2579b647 100644 --- a/1-js/02-first-steps/13-while-for/article.md +++ b/1-js/02-first-steps/13-while-for/article.md @@ -368,9 +368,18 @@ break label; // jump to the label below (doesn't work) label: for (...) ``` -A call to `continue` is only possible from inside the loop. +A `break` directive must be inside a code block. Technically, any labelled code block will do, e.g.: +```js +label: { + // ... + break label; // works + // ... +} +``` -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. +...Although, 99.9% of the time `break` used is inside loops, as we've seen in the examples above. + +A `continue` is only possible from inside a loop. ```` ## Summary