Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Do while loop
1. This loop will execute the code block once, before checking if the condition is true, and then
it will repeat the loop as long as the condition is true.
Syntax:
see example below:
This prints out numbers from 20 to 25.
Do While Loop
var i=20;
do {
document.write(i + "<br />");
i++;
}
while (i<=25);
do {
code block
}
while (condition);