Multiple choice javascript

How does a "for" loop start?

  1. for (i = 0; i <= 5)

  2. for (i = 0; i <= 5; i++)

  3. for i = 1 to 5

  4. for (i <= 5; i++)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A for loop requires three parts separated by semicolons: initialization, condition, and increment. Option B correctly shows this structure: i=0 initializes the counter, i<=5 is the condition, and i++ increments after each iteration. Options A, C, and D are missing required parts or use incorrect syntax.