javascript do while loop tutorial

The do while loop repeatedly executes a block of statements until a particular condition is true. It first executes a block of statements and then check the condition.

Syntax:

do { 
//Block of statements 
}while(condition);

:

<html>
<head>
<script>  
var num=1;  
do{   
document.write(num + "<br/>") ;
num++;
}  while (num<=10)  
</script> 
</head>
<body> 
</body>
</html>

Try it:

JS Bin on jsbin.com