For Loops

Before we start working, it will be good to review again the for loop construction:

For loops consist of:

  • Initialization block in which the variable-counter is declared (var i) and its initial value is set.
  • Repeat condition (i <= 10), executing once, before each iteration of the loop.
  • Restarting the counter (i++) – this code is executed after each iteration.
  • Body of the loop - contains random block of source code.

results matching ""

    No results matching ""