Ranges can be assigned to variables

This commit is contained in:
EricFromCanada
2021-02-22 17:09:17 -05:00
parent 09e4fef712
commit 0f83e333c4

View File

@@ -129,7 +129,7 @@ Begins the loop at the specified index.
### range
Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers.
Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers, and can be pulled from a variable.
<p class="code-label">Input</p>
```liquid
@@ -139,7 +139,8 @@ Defines a range of numbers to loop through. The range can be defined by both lit
{% endfor %}
{% assign num = 4 %}
{% for i in (1..num) %}
{% assign range = (1..num) %}
{% for i in range %}
{{ i }}
{% endfor %}
{% endraw %}