Simple compare function typically use in sorting.

This function is valid in v2.0.0 to v2.24.2. This function has been downloaded 40 times.


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


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

Requiring Functions

This function is directly required by the following functions:

  • bindCompare()
    Creates a compare function which binds the namespaces within the two given objects.
  • sortBy()
    Shallow copies and sorts an array given specific criteria.