Returns the median of the dataset. The 'expr.method' defaults to "approximate" to return a median value from the dataset.

If 'expr.method' is "approximate", we return the smallest of the middle values when dataset is even. If 'expr.method' is "exact", we return the average of the middle values when dataset is even. For an odd dataset, the middle value is always returned regardless of 'expr.method'.

  • Parameters

    • collection: unknown[]

      The collection of objects.

    • expr: unknown

      The operator expression.

    • options: Options

      Options to use for processing.

    Returns number