Files
lo/docs/data/core-minindex.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

690 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
MinIndex minindex find.go#L287 core find https://go.dev/play/p/RxAidik4p50
core#find#minindex
core#find#min
core#find#minby
core#find#minindexby
core#find#max
core#find#maxby
core#find#maxindex
core#find#maxindexby
core#math#sum
core#math#mean
core#math#product
core#math#mode
150
func MinIndex[T constraints.Ordered](collection []T) (T, int)

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

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