Skip to content

Instantly share code, notes, and snippets.

@danhodge
Created October 2, 2011 20:19
Show Gist options
  • Save danhodge/1257875 to your computer and use it in GitHub Desktop.
Save danhodge/1257875 to your computer and use it in GitHub Desktop.
Ruby Array Tips
# Use .transpose to 'unzip' an array of arrays
[ [ 1, 'a' ], [ 2, 'b' ], [ 3, 'c' ] ].transpose # => [ [ 1, 2, 3 ], [ 'a', 'b', 'c' ] ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment