Back to Lo

Core Lastor

docs/data/core-lastor.md

1.53.0122 B
Original Source

Returns the last element of a collection or the fallback value if empty.

go
v := lo.LastOr([]int{}, -1)
// v == -1