Passing no parameters will specify ascending lexicographical order (alphabetical).
However, you also have the option of passing in a function which array.sort will use to sort your array. The function you pass in is supposed to compare exactly two elements with each other, and the array.sort function will use your function in order to sort the entire array efficiently. Your function is simply supposed to compare the two values.
Your function should return a negative number if a comes before b, 0 if a is equal to b, and a positive number if a comes after b. Therefore return b - a
will work for descending order because whenever b - a is positive, b is larger, and therefore will come before a, thus "descending". Similar for negative and equivalent values.