@tempots/std
compareArrays() function
Compares two arrays based on their lengths and element values.
Signature:
compareArrays: (a: A[], b: A[], comparef: Compare, shorterFirst?: boolean) => number
Parameters
Parameter |
Type |
Description |
---|---|---|
a |
A[] |
The first array to compare. |
b |
A[] |
The second array to compare. |
comparef |
The compare function to use for comparing the elements of the arrays. | |
shorterFirst |
boolean |
(Optional) Specifies whether shorter arrays should be considered smaller. Defaults to true. |
Returns: number
A compare function that can be used to compare arrays.