elem1This argument specifies the first element for comparison to evaluate.
elem2This argument specifies the second element for comparison to evaluate.
comparatorContextThis argument specifies the optional parameter to indicate the outcome of the comparison.
Zurückgegebener Wert
int32
This method returns the result of comparing elem1 and elem2:
>0 : elem1 is greater than (goes after) elem2,
=0 : elem1 is equal to elem2,
<0 : elem1 is less than (goes before) elem2.