<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript do...while loop</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
number = 1;
do {
document.writeln(number + " times");
number++;
} while (number <= 10)
document.writeln("Total " + (number - 1) + " times loop repeat");
</script>
</pre>
</body>
</html>