Back to Lo

Core Firstorempty

docs/data/core-firstorempty.md

1.53.0120 B
Original Source

Returns the first element of a collection or the zero value if empty.

go
v := lo.FirstOrEmpty([]int{})
// v == 0