ichigyou
    Preparing search index...

    Function median

    • Calculates the median of an array of numbers.

      Parameters

      • arr: number[]

        The array of numbers.

      Returns number

      The median of the array. If the array length is even, it returns the average of the two middle numbers. Otherwise, it returns the middle number.