Thyme for function
3 posts • Page 1 of 1
Thyme for function
How to use the function "For" in thyme ? how it works ?
- Skrubs
- Posts: 16
- Joined: Tue Mar 06, 2018 7:36 pm
Re: Thyme for function
The for function is used with this syntax:
for(limit,(counter)=>{code})
Limit is a number or variable containing a number, specifying for often the loop executes(it maxes out at 100 iterations however). The counter is any variable name, most often "i". It stores the index of the current iteration.
An example would be:
for(5,(i)=>{
text = text + i
})
After running the script, the objects text variable would have "01234" attached to the end.
for(limit,(counter)=>{code})
Limit is a number or variable containing a number, specifying for often the loop executes(it maxes out at 100 iterations however). The counter is any variable name, most often "i". It stores the index of the current iteration.
An example would be:
for(5,(i)=>{
text = text + i
})
After running the script, the objects text variable would have "01234" attached to the end.
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests