Back to Lo

Core Times

docs/data/core-times.md

1.53.0208 B
Original Source

Invokes the predicate n times, returning a slice of results. The predicate receives the index on each call.

go
lo.Times(3, func(i int) string {
    return strconv.Itoa(i)
})
// []string{"0", "1", "2"}