Ember.Comparable Class
Implements some standard methods for comparing objects. Add this mixin to any class you create that can compare its instances.
You should implement the compare()
method.
Item Index
Methods
Methods
compare
(
Integer
-
a
-
b
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
Objectthe first object to compare
-
b
Objectthe second object to compare
Returns:
Integer:
the result of the comparison