# forloop
Information about a parent [`for` loop](https://shopify.dev/docs/api/liquid/tags/for).
## Properties
| Property | Type | Description |
|----------|------|-------------|
| `first` | boolean | "Returns `true` if the current iteration is the first. Returns `false` if not." |
| `index` | number | The 1-based position of the current iteration. |
| `index0` | number | The 0-based position of the current iteration. |
| `last` | boolean | "Returns `true` if the current iteration is the last. Returns `false` if not." |
| `length` | number | Total number of iterations in the loop. |
| `parentloop` | forloop | The parent `forloop` object, or `nil` if not nested within another loop. |
| `rindex` | number | The 1-based position counting backward from the loop's end. |
| `rindex0` | number | The 0-based position counting backward from the loop's end. |
## Example Usage
Access the parent loop's index within nested loops:
```liquid
{% for i in (1..3) -%}
{% for j in (1..3) -%}
{{ forloop.parentloop.index }} - {{ forloop.index }}
{%- endfor %}
{%- endfor %}
```
Output nested iteration positions showing outer and inner loop indices.
## Practical Example
Building a comma-separated list of page titles:
```liquid
{% for page in pages -%}
{%- if forloop.length > 0 -%}
{{ page.title }}{% unless forloop.last %}, {% endunless -%}
{%- endif -%}
{% endfor %}
```
Renders: `About us, Contact, Potion dosages`