0003 Splat_operator

The splat operator is a handy way of manipulating arrays and arguments.

It is possible to deconstruct/decompose an array during assignment.


This also applies when creating an array.


When defining a method, the splat operator merges the targeted arguments into a single array.


When calling a method, the splat operator turns an array into an argument list.


Links to Ruby documentation for the splat operator: assignment, method arguments*.

*Note that the documentation is not up to date: The behavior about keyword arguments is effectively removed and there is no warning if the splat operator comes first when calling a method without parentheses.