LearnFrenzy
Sign in Take a free test

Loops · JavaScript Loops MCQ · Question 7

An infinite for loop Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 7 Back to Exercise

Which of these is a valid infinite loop that needs a break to stop?

  • A for () { … }
  • B for (;;) { … } Correct
  • C for (true) { … }
  • D loop { … }
Correct Answer: Option B

All three parts of a for header are optional; an empty condition counts as true. while (true) works the same way.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links