Files
lo/docs/data/core-max.md
T
2025-10-06 17:15:49 +02:00

634 B

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

Searches the maximum value of a collection. Returns zero value when the collection is empty.

max := lo.Max([]int{2, 5, 3})
// 5