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

730 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
Mode mode math.go#L149 core math
core#math#mode
core#math#mean
core#math#meanby
core#math#sum
core#math#sumby
core#math#product
core#math#productby
core#find#min
core#find#max
core#find#minby
core#find#maxby
core#math#countvalues
core#math#countvaluesby
100
func Mode[T constraints.Integer | constraints.Float](collection []T) []T

Returns the mode(s), i.e., the most frequent value(s) in a collection. If multiple values share the highest frequency, returns all. Empty input yields an empty slice.

lo.Mode([]int{2, 2, 3, 3})
// []int{2, 3}