• Creates a Comparator that compares the elements of two Arrays pairwise.

    Finds the first unequal pair and returns the result.

    If all pairs are equal the Array's length will be used for comparison.

    Example

    Compare two Arrays of numbers

    const numberArrayComparator = arrayComparator(numberComparator);
    const result = numberArrayComparator([1, 1], [2]);
    console.log(result); // 1

    Returns

    a Comparator for Arrays of type T

    Type Parameters

    Parameters

    Returns Comparator<ArrayLike<T>>

Generated using TypeDoc