Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # did not return nil exception
- to_s >> to_splat. nil.to_splat
- # Multiple splats allowed
- def foo(*a)
- a
- end
- foo(1, *[2,3], 4, *[5,6]) # => [1, 2, 3, 4, 5, 6]
- a = [1,2,3]
- b = [4,5,6]
- [*a, *b] # => [1, 2, 3, 4, 5, 6]
Add Comment
Please, Sign In to add comment