compare()

Simple compare function typically use in sorting.

This function is valid in v2.0.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{*} a
First argument to compare.
{*} b
Second argument to compare.

Returns

{number}
-1 is returned if a < b. 1 is returned if a > b. In all other cases 0 is returned.

Requiring Function

This function is directly required by the following function:

  • sortBy()
    Shallow copies and sorts an array given specific criteria.