It seems like you are looking for the mode function:
mode
julia> using StatsBase julia> mode([1, 3, 2, 1, 4, 1]) 1