Function _sort

  • Sort array

    Comparison function receives two arguments representing array elements and should return:

    • negative number in case first argument is more significant then second
    • zero in case first argument is equaly significant as second
    • positive number in case first argument is less significant then second

    Type Parameters

    • T

    Parameters

    • fn: ((x, y) => number)
        • (x, y): number
        • Parameters

          Returns number

    • arr: T[]

    Returns T[]