In JavaScript, in addition to the while and for loops, there is another variant of the do-while loop:
do{
}while();
The meaning of this construct is that what is inside the curly braces is executed first, and then the while() condition is checked. If the condition is true, then the loop is repeated, if false, then the loop ends. Thus, the loop will be executed at least once. This loop is used less frequently than the previous two because it is easier for a human to understand a regular while loop to read the condition, rather than looking for the condition at the end of the loop. Continue reading