<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript array iteration in for loop</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
for ( var num = 0; num < arr.length; num ++ ) {
document.writeln(num + " iterate");
}
document.writeln("End of array for loop");
</script>
</pre>
</body>
</html>