Slide 18
Slide 18 text
splat arguments, anywhere (1.9+)
# def foo(*args); p args; end
# foo(1, 2, 3, 4)
[1, 2, 3, 4]
# def bar(first, *args); p first; p args; end
# bar(1, 2, 3, 4)
1
[2, 3, 4]
# def baz(first, *args, last); p first; p args; p last; end
# baz(1, 2, 3, 4)
1
[2, 3]
4
17/23 - 74%