TypeScript do while loop

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:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do {
//Block of statements
}while(condition);
do { //Block of statements }while(condition);
do { 
//Block of statements 
}while(condition);

TypeScript do while loop example:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
var num:number=1;
do{
console.log(num);
num++;
} while (num<=10);
var num:number=1; do{ console.log(num); num++; } while (num<=10);
var num:number=1;  
do{   
console.log(num);
num++;
}  while (num<=10);