rhai/doc/src/language/loop.md

16 lines
229 B
Markdown
Raw Normal View History

2020-06-20 06:06:17 +02:00
Infinite `loop`
===============
{{#include ../links.md}}
```rust
let x = 10;
loop {
x = x - 1;
if x > 5 { continue; } // skip to the next iteration
print(x);
if x == 0 { break; } // break out of loop
}
```