mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 17:26:55 +08:00
Add break statement to cheatsheet.md
Added information about the existence of the break statement to the loop section.
This commit is contained in:
parent
50dcbc8c7e
commit
c9034a0485
@ -313,6 +313,15 @@ while (some_condition()) { /* do something */ }
|
||||
for (x : [1,2,3]) { print(i); }
|
||||
```
|
||||
|
||||
Each of the loop styles can be broken using the `break` statement. For example:
|
||||
|
||||
```
|
||||
while (some_condition()) {
|
||||
/* do something */
|
||||
if (another_condition()) { break; }
|
||||
}
|
||||
```
|
||||
|
||||
## Conditionals
|
||||
|
||||
```
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user