While
While loops repeatedly check a condition and run a block of code until the condition is false
.
main.w
let var i = 0;
whilei < 2 {
log("while {i}");
i = i + 1;
}
Wing console output
# Run locally with wing console
wing it
while 0
while 1
While loops repeatedly check a condition and run a block of code until the condition is false
.
let var i = 0;
whilei < 2 {
log("while {i}");
i = i + 1;
}
# Run locally with wing console
wing it
while 0
while 1