rhai/doc/src/language/while.md

16 lines
236 B
Markdown
Raw Normal View History

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