Skip to content

Instantly share code, notes, and snippets.

@trak3r
Created August 15, 2012 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trak3r/3361147 to your computer and use it in GitHub Desktop.
Save trak3r/3361147 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p0 :001 > nested_arrays = [[1,2,3],4,5,6]
=> [[1, 2, 3], 4, 5, 6]
ruby-1.9.2-p0 :002 > x = nested_arrays.first.first
=> 1
ruby-1.9.2-p0 :003 > x
=> 1
ruby-1.9.2-p0 :004 > (z,), = nested_arrays
=> [[1, 2, 3], 4, 5, 6]
ruby-1.9.2-p0 :005 > z
=> 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment