rhai/scripts/loop.rhai
2022-01-20 12:06:36 +08:00

15 lines
199 B
JavaScript

// This script runs an infinite loop, ending it with a break statement.
let x = 10;
// simulate do..while using loop
loop {
print(x);
x -= 1;
if x <= 0 { break; }
}
export x as foo;