• Compares two arrays in ascending, descending, or no particular order.

    The comparison is case-insensitive and is done based on the first item of each array. An empty array is always considered less than a non-empty array.

    Parameters

    • arrayA: any

      The first array to compare.

    • arrayB: any

      The second array to compare.

    • sortOrder: "asc" | "desc" | "noSort"

      The order in which to compare the arrays. 'asc' for ascending, 'desc' for descending, 'noSort' for no specific order.

    Returns number

    • Returns 0 if the arrays are equal or both are empty, -1 if arrayA is less than arrayB, or 1 if arrayA is greater than arrayB. If sortOrder is 'asc', -1 means arrayA comes first. If sortOrder is 'desc', -1 means arrayB comes first.

Generated using TypeDoc