for and forsep Tag
Purpose: The for tag is used to program a loop. First, the assignment expression is evaluated. In general, the assignment expression initializes the loop variable. The second expression is evaluated before each loop iteration and must result in a Boolean expression. While the second expression evaluates to true, the actions defined in the body of the loop are executed. After each loop iteration, the third expression is evaluated. In general, the third expression increments or decrements the loop variable. An optional forsep section can be specified which is executed between two loop iterations. In contrast to the third expression of the for tag which is evaluated after each loop iteration, the forsep section is not executed after the last loop iteration. An alternative to the for loop is the while loop. To loop over all fields of an object or all characters of a string, use the forin loop. Example:
Selected blog articles : 3D Objects on HTML pages, CSS Transition Visibility, and CSS Transition Display. © 1996-2025 H.E.I. All Rights Reserved. |
![]() |