Function reference · Statistics
mode
Finds the most frequently occurring value.
mode counts exact expression values and returns the most frequent one. When multiple values tie for highest frequency, the result remains symbolic instead of arbitrarily selecting one.
Examples
These examples use Nerdamer Notation.
Find the unique most frequent value.
mode(2,3,2,4)
// → 2Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
mode(arg1, ...)
nerdamer.mode
Call the operation through the default nerdamer import.
nerdamer.mode(...args: StatisticsInput[]): Expression
Parameters
| Name | Type | Description |
|---|---|---|
args | StatisticsInput[] | — |
Returns
Direct JavaScript / TypeScript API
Import the operation directly from its package entry point.
import { mode } from 'nerdamer/statistics';
mode(...args: StatisticsInput[]): Expression
Parameters
| Name | Type | Description |
|---|---|---|
args | StatisticsInput[] | — |
