Only valid as the expression of a for-of loop!
Used to compile directly to normal Lua numeric for loops. For example,
for (const i of $range(1, 10)) { print(i);} Copy
for (const i of $range(1, 10)) { print(i);}
will compile into
for i = 1, 10 do print(i)end Copy
for i = 1, 10 do print(i)end
The step argument controls the amount incremented per loop. It defaults to 1.
step
1
Optional
Only valid as the expression of a for-of loop!
Used to compile directly to normal Lua numeric for loops. For example,
will compile into
The
step
argument controls the amount incremented per loop. It defaults to1
.