The for loop is not supported in the custom function, but the loop statement logic can be completed with Range
definition:
Range range = Ranges.of(Integer start,Integer end)
range. each {
}
Note: Up to 200 cycles
Example:
Range range = Ranges.of(1,5)
range. each {
it->
} //return: [1,2,3,4,5]