diff --git a/_tags/iteration.md b/_tags/iteration.md index 1db7709..86b6469 100644 --- a/_tags/iteration.md +++ b/_tags/iteration.md @@ -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.
Input
```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 %}