Nearby lessons
17 of 40🔂 JavaScript for Loop
📌 What is JavaScript for Loop?
The for loop repeats a block of code a specific number of times.
Perfect when you know exactly how many iterations you need.
📋 for Loop Basics
| Attribute | Description |
|---|---|
Syntax | for (initialization; condition; increment) |
Initialization | Executes once before loop starts |
Condition | Evaluated before each iteration |
Increment | Executed after each iteration |
🔹Print 1 to 10 Using for loop
Example03
🔹Print 10 to 1 Using for loop
Example04
🔹Print Even Number Using for loop
Example05
🔹Print Odd Number Using for loop
Example06
🔁 Nested for Loops
| Attribute | Description |
|---|---|
Usage | Creating grids/multi-dimensional arrays |
Outer Loop | Controls rows |
Inner Loop | Controls columns |
Example07
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2