Quiz

JavaScript Loops and Conditionals Quiz

8 questions on for, while, if/else, and switch — the basic logic for controlling how code runs.

8
questions
~4 min
to complete
instant result
Question 1 of 8
How many times does for (let i = 0; i < 3; i++) run?
Question 2 of 8
What does break do inside a loop?
Question 3 of 8
What does continue do inside a loop?
Question 4 of 8
How does while differ from for?
Question 5 of 8
When should you use switch instead of a chain of if/else?
Question 6 of 8
What happens without a break inside a case in switch?
Question 7 of 8
What does Boolean(0) return?
Question 8 of 8
Which loop is guaranteed to run at least once?
0/8