Type in the words(s) to search for:

    Mark results
      Userbooster Help

      for Statement

      Executes a block of statements for as long as a specified condition is true.

      for ( initialization; test; increment) 
         statement 

      Arguments

      initialization

      Initialization expression, which is executed only once before the loop's execution begins. The argument is optional.

      test

      Boolean expression. If test is true, the statement is executed; otherwise the loop terminates.

      increment

      Increment expression, which is executed at the end of every loop iteration. The argument is optional.

      statement

      One or more statements that are executed if test is true. It can be a compound statement. The argument is optional.

      Example

      function function_returns_8()
      {
      var x = 3;
          for( i = 0; i < 10; i++ )
          {
              if( i < 5 )
                  continue;
              x++;
          }
          return x;
      }