Last active
September 2, 2016 20:02
-
-
Save JamesMcMahon/ae71ff4ca3489d94930108182cc64179 to your computer and use it in GitHub Desktop.
Head and Tail in Ruby splats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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