math.mode( $arg as (String | Number | Boolean | null | Array | Object), [$options as String] ) as ValueIterator
Returns the mode of a sequence. The mode is the value that occurs most frequently in a data set. If no value occurs more than once in the data set, the function returns the empty sequence. If the input is the empty sequence, the function returns the empty sequence.
Note that a data set can have multiple “modes”. The order of multiple modes in the returned sequence is undefined.
Also note that values from a lexicon lookup are repeated
cts:frequency times before calculating the mode.
The function can be used on numeric values,
|$arg||The sequence of values.|
Options. The default is ().
math.mode([1,2,2,3,2,3,4,6,7,7,7]) => 2 7