<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript for loop condition param optional</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
var num = 1;
for(; ; num++){
if (num <= 10)
document.writeln(num + ": iteration");
else
break;
}
document.writeln("End of for loop");
</script>
</pre>
</body>
</html>