With one splat, we can expand the array into several arguments, which is very different from passing the array directly:
def foo(a, b = nil, c = nil) a end args = [1, 2, 3] foo(args)
With the keyword arguments, however, I see no difference, since they are just syntactic sugar for hashes:
def foo(key:) key end args = { key: 'value' } foo(args)
Besides good symmetry, is there a practical reason to use double signs when calling a method? (Note that this is different from using them when defining a method)
source share