Back to Lo

Core Minindex

docs/data/core-minindex.md

1.53.0172 B
Original Source

Returns the minimum value and its index. Returns (zero value, -1) when the collection is empty.

go
value, idx := lo.MinIndex([]int{2, 5, 3})
// value == 2, idx == 0