# Function median

- median(values: readonly number[]): number

  Compute the lower-median of a numeric array.

  Deterministic: input is sorted ascending with the stable JS sort. For even-length arrays the lower of the two middle elements is returned — this avoids floating-point ties that depend on iteration order.

  #### Parameters

  - values: readonly number[]

    Numeric samples (will be copied, not mutated)

  #### Returns number

  Lower median, or 0 for empty inputs

  - Defined in utils/lifecycleStatistics.ts:144