Groovy `times` 迭代器的文档

Groovy documentation on `times` iterator

在哪里可以找到关于这种 4.times 迭代器的文档?

4.times { counter ->
    tasks.register("task$counter") {
        doLast {
            println "I'm task number $counter"
        }
    }
}
tasks.named('task0') { dependsOn('task2', 'task3') }

我似乎无法在 docs 中找到它,但到处都是使用它的示例。

source of code

Groovy JDK API Documentation for Number.times(Closure closure):

Executes the closure this many times, starting from zero. The current index is passed to the closure each time. Example:

10.times {
  println it
}

Prints the numbers 0 through 9.

Parameters:
closure - the closure to call a number of times

Since:
1.0

这是Groovy添加到java.lang.Numberclass的方法。