# repeat

    .repeat times:{Int} body:{Lambda} -> Iterable<Any>

Content copied to clipboard

Repeats content `N` times. This is shorthand for `.foreach {..N}`.

The current index (starting from 1) can be accessed via the lambda argument.

    .repeat {5}
        index:
        Iteration number .index

Content copied to clipboard

In implicit form:

    .repeat {5}
        Iteration number .1

Content copied to clipboard

As with forEach, the output is a mapping from `[1, N]` to another collection of values. See forEach's documentation for further details.

#### Return

a collection that contains the output of each iteration

#### Parameters

times

number of times to repeat the content

body

- Likely a body argument

the output of each iteration. Accepts 1 parameter (the current repetition index, starting from 1).

#### Wiki page

loops