Methods, Blocks, & Sorting


Finally, let's review what we learned about sorting.

books.sort! do |firstBook, secondBook|
  firstBook <=> secondBook

Remember that the above example was how we sorted in alphabetical order.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.