@vsokolov/utils - v0.32.0
    Preparing search index...

    Function sort

    • Sort array by specific function or by the first numeric value in objects

      Type Parameters

      • T extends Record<string, unknown>

      Parameters

      • arr: T[] = []

        Array to sort

      • OptionalfSorting: (first: T, second: T) => number

        Function sorting algorithm, defaults to sorting by first numeric value

      Returns T[]

      Sorted array