While

The while construct is almost like the if construct, except that it will keep executing its block as long the given expression is true.

var n = 10

while (n > 0) {
    say n
    n -= 1
}

Last updated