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: T, y: T) => number
    • arr: T[]

    Returns T[]