diff options
Diffstat (limited to 'doc/docs/de/doc/control-flow/continue.md')
| -rw-r--r-- | doc/docs/de/doc/control-flow/continue.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/docs/de/doc/control-flow/continue.md b/doc/docs/de/doc/control-flow/continue.md new file mode 100644 index 0000000..b000765 --- /dev/null +++ b/doc/docs/de/doc/control-flow/continue.md | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | # Continue | ||
| 2 | |||
| 3 | A continue statement can be used to skip the current iteration in a loop. | ||
| 4 | |||
| 5 | ```yuescript | ||
| 6 | i = 0 | ||
| 7 | while i < 10 | ||
| 8 | i += 1 | ||
| 9 | continue if i % 2 == 0 | ||
| 10 | print i | ||
| 11 | ``` | ||
| 12 | <YueDisplay> | ||
| 13 | |||
| 14 | ```yue | ||
| 15 | i = 0 | ||
| 16 | while i < 10 | ||
| 17 | i += 1 | ||
| 18 | continue if i % 2 == 0 | ||
| 19 | print i | ||
| 20 | ``` | ||
| 21 | |||
| 22 | </YueDisplay> | ||
| 23 | |||
| 24 | continue can also be used with loop expressions to prevent that iteration from accumulating into the result. This examples filters the array table into just even numbers: | ||
| 25 | |||
| 26 | ```yuescript | ||
| 27 | my_numbers = [1, 2, 3, 4, 5, 6] | ||
| 28 | odds = for x in *my_numbers | ||
| 29 | continue if x % 2 == 1 | ||
| 30 | x | ||
| 31 | ``` | ||
| 32 | <YueDisplay> | ||
| 33 | |||
| 34 | ```yue | ||
| 35 | my_numbers = [1, 2, 3, 4, 5, 6] | ||
| 36 | odds = for x in *my_numbers | ||
| 37 | continue if x % 2 == 1 | ||
| 38 | x | ||
| 39 | ``` | ||
| 40 | |||
| 41 | </YueDisplay> | ||
