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 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.