Repeat

Do While Loop

JavaScript

 

Do While loop

ECMAScript 5
var count = 5;

do {
    count--;
    console.log(count);
} while(count > 0);

The code inside the do-while block runs as long as the condition count > 0 evaluates to true.

The difference between do-while and while is that, in do-while the block is first run and then the condition is checked.

This means that no matter what do-while condition is, the block will always run at least once.

This will print 4 3 2 1 0 on Console.