Back to Lo

Core Foreach

docs/data/core-foreach.md

1.53.0200 B
Original Source

Iterates over elements of a collection and invokes the callback for each element.

go
lo.ForEach([]string{"hello", "world"}, func(x string, _ int) {
    println(x)
})
// prints "hello\nworld\n"