This code works, I just don't have a strong understanding on why it's working.
# This code sorts books in descending order, in-place below... # This is code I wrote, which works, what effect does the ! have after the sort method name? books.sort! do |firstBook, secondBook| if firstBook < secondBook 1 elsif firstBook > secondBook -1 else 0 end end # This below code is the example that codeacademy provided for the sort, why in their example does it NOT have # the ! after the books.sort? # books.sort do |first, second| if first < second # first book before second alphabetically -1 elsif first > second # first after second 1 else # first and second are the same 0 end end