• Returns the median value of a given path

    Example

    median([{foo: 10}, {foo: 10}, {foo: 20}, {foo: 40}], 'foo'); // 15
    

    Type Parameters

    • Value extends Record<string, unknown>

    • Path extends string = never

    Parameters

    • array: Value[]
    • Optional path: Path

    Returns number

  • Returns the median value of a given path

    Example

    median([1, 1, 2, 4]); // 1.5
    

    Type Parameters

    • Value

    Parameters

    • array: Value[]

    Returns number

Generated using TypeDoc