<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript break with do...while loop</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
var i = 0;
do {
if (i == 5){
document.writeln("terminated, i = 5");
break;
}
document.writeln(i);
i++;
} while(i <= 10)
</script>
</pre>
</body>
</html>