<!DOCTYPE html>
<html>
<head>
  <title>Loop</title>
</head>
<body>
  <h2>Nested Loop</h2>
  
  <script>
    
for (let i = 0; i < 3; i++) {
    document.write("Outer loop iteration: " + i , `<br>`);
    for (let j = 0; j < 2; j++) {
        document.write("   Inner loop iteration: " + j, `<br>`);
    }
}
    
  </script>
</body>
</html>
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.