March 2019
Intermediate to advanced
412 pages
9h 49m
English
Loop counting is provided for free, yielding an index of the current iteration of the loop. As variables, this can be accessed in a few different ways. The following table outlines the ways they can be referenced:
| Variable | Description |
| loop.index | The current iteration of the loop (1 indexed) |
| loop.index0 | The current iteration of the loop (0 indexed) |
| loop.revindex | The number of iterations until the end of the loop (1 indexed) |
| loop.revindex0 | The number of iterations until the end of the loop (0 indexed) |
| loop.first | Boolean True if the first iteration |
| loop.last | Boolean True if the last iteration |
| loop.length | The number of items in the sequence |
Having information related to the position within the loop can help ...
Read now
Unlock full access