compare (a, b) Number
private
Required. You must implement this method to apply this mixin.
Override to return the result of the comparison of the two parameters. The compare method should return:
-
-1
ifa < b
-
0
ifa == b
-
1
ifa > b
Default implementation raises an exception.
Parameters:
-
a
Object
- the first object to compare
-
b
Object
- the second object to compare
Returns:
-
Number
- the result of the comparison
Please login to continue.