Quotes help make search much faster. Example: "Practice Makes Perfect"

Wednesday, November 21, 2012

Codecademy: "Getting Technical!"


#sample solution


books = ["Charlie and the Chocolate Factory", "War and Peace", "Utopia", "A Brief History of Time", "A Wrinkle in Time"]

# To sort our books in ascending order, in-place
books.sort! { |firstBook, secondBook| firstBook <=> secondBook }

# Sort your books in descending order, in-place below
puts books.sort!.reverse!

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts