For example, the compare method compares two strings; the sort and asort methods sort arrays or associative arrays in a way similar to the corresponding PHP array functions.
Now, for classes that store large amounts of data, this method may not be the most efficient way to swap data, because swap involves one copy construction and two assignments.
In this sense, because of the way these two methods are set up, they truly make calling an Ajax method in jQuery exactly like calling any other method in jQuery.