Skip to content

Instantly share code, notes, and snippets.

@rubydubee
Created June 30, 2011 22:13
Show Gist options
  • Save rubydubee/1057406 to your computer and use it in GitHub Desktop.
Save rubydubee/1057406 to your computer and use it in GitHub Desktop.
Sorting Example 2
arrays = [[1,2,3], [100], [10,20]]
arrays.sort_by { |x| x.size } # => [[100], [10, 20], [1, 2, 3]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment