While loops loop though a block of code as long as the specified condition holds true. Its syntax is as follows.
while (condition) {
// code block to be executed
}
In the following example, the code in the loop will run over and over again, as long as the variable i is less than 10.
while (i < 10) {
text = text + "The number is " + i;
i = i + 1;
}
If you forget to increase the variable used in the condition, the loop will never end, resulting in an infinite loop.
The next part discusses for loops in Cuneiform.