Skip to content

While Loop in VG Language

A while loop repeatedly executes a block of code as long as a given condition evaluates to true. This is useful when the number of iterations is not known beforehand.

var x = 0;
while (x < 5) {
    print(x);
    x = x + 1;
}