Do While Loop

The do / while loop will execute the code block once before checking the condition is true, then it will repeat the loop as long as condition is true.

Code Structure
var cities = ["London", "Reading", "Liverpool"];
var i = 0;
do {
 alert(cities[i]);
 i++;
}
while(i < cities.length);

Share this

Related Posts