rhai/doc/src/language/loop.md
2020-06-20 12:06:17 +08:00

229 B

Infinite loop

{{#include ../links.md}}

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
}