Back to Lo

Core Concat

docs/data/core-concat.md

1.53.0226 B
Original Source

Returns a new slice containing all the elements in collections. Concat conserves the order of the elements.

go
list1 := []int{0, 1}
list2 := []int{2, 3, 4, 5}
flat := lo.Flatten(list1, list2)
// []int{0, 1, 2, 3, 4, 5}