Function sortObjectArrayByKey

  • Sorts an array of objects by a key.

    Returns

    a new Array of Objects sorted by the provided key

    Type Parameters

    • T = object

    Parameters

    • arr: T[]

      The Array of Objects to be Sorted

    • key: keyof T

      The Key of the Object to Sort the Array By

    • sortFunction: SortFunction | "asc" | "desc" = "asc"

      the Direction to Sort the Array or a Custom Sort Function

    Returns T[]

Generated using TypeDoc