JavaScript Loops : Do-While Loop

The do...while loop is a variant of the while loop. It is similar to the while loop except that the condition check happens at the end of the loop. This means that the loop will always be executed at least once, even if the condition is false. The Syntax of do...while loop is as follows :
 do {
   code to be executed
 } while (condition);
For example :
<!DOCTYPE html>
  <title>Do...While Loop</title>
  <p id="demo"></p>
    var x = 2, count = 0;
    var text = '';
    do {
      text = text + x*count + '<br/>';
    } while(count <= 10);

    document.getElementById("demo").innerHTML = text;
Output :

Next Topic :