Skip to content

Instantly share code, notes, and snippets.

@toothrot
Created June 25, 2010 18:28
Show Gist options
  • Save toothrot/453238 to your computer and use it in GitHub Desktop.
Save toothrot/453238 to your computer and use it in GitHub Desktop.
# via jaknowlden:
irb(main):001:0> (k, v), *rest = [[1,2], [3,4], [5,6]]
=> [[1, 2], [3, 4], [5, 6]]
irb(main):002:0> k
=> 1
irb(main):003:0> v
=> 2
irb(main):004:0> rest
=> [[3, 4], [5, 6]]
@thumblemonks
Copy link

*["Nope", "Too late", "Not trying now"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment