Nearby lessons
18 of 40🔄 JavaScript while Loop
📌 What is JavaScript while Loop?
The while loop executes code while a condition is true.
Ideal when the number of iterations is unknown.
📋 while Loop Basics
| Attribute | Description |
|---|---|
Syntax | while (condition) |
Condition | Evaluated before each iteration |
Usage | When iterations are unknown |
🔹Print 1 to 10 Using while loop
Example03
🔹Print 10 to 1 Using while loop
Example04
🔹Print Even Number Using while loop
Example05
🔹Print Odd Number Using while loop
Example06
🧠 Test Your Knowledge
2 QuestionsProgress: 0 / 2