Skip to content

Instantly share code, notes, and snippets.

@JamesMcMahon
Last active September 2, 2016 20:02
Show Gist options
  • Save JamesMcMahon/ae71ff4ca3489d94930108182cc64179 to your computer and use it in GitHub Desktop.
Save JamesMcMahon/ae71ff4ca3489d94930108182cc64179 to your computer and use it in GitHub Desktop.
Head and Tail in Ruby splats
# split head and tail
(head, *tail) = [1, 2, 3]
# head is 1
# tail is [2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment