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

Wednesday, November 21, 2012

Codecademy: "Sorting"


#sample solution


fruits = ["orange", "apple", "banana", "pear", "grapes"]

#fruits.sort!.reverse! would have been simpler
fruits.sort! {|firstfruit,secondfruit| secondfruit<=>firstfruit}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts