for (numeric)
Numeric loop.
Syntax
for i = start, end, step do ... end
Description
for i = 1, 5 → from 1 to 5 (both inclusive). The third number is the step.
Example
Loading editor…
Expected output
1 2 3
When to use?
Known repetition.
Common mistakes
- ⚠️ for i=1,5 → 5 IS INCLUSIVE (unlike other languages).