Finally, let’s review what we learned about sorting.
books.sort! do |firstBook, secondBook| firstBook <=> secondBook end
Remember that the above example was how we sorted in alphabetical order.
.sort! to sort the
fruits array in descending (that is, reverse) alphabetical order. You can use the combined comparison operator (like the example above) or an