davincicoders/ruby_koans_argroves — pull request #6 by ArGroves (2013-08-03 19:35:08+00:00)
Title: 54146063 about array assignment master

Passed a test in about_array_assignment.rb …

- Surprisingly, arrays work much like every other object in that you
can assign them to variables.

- You can do a cool thing where you assign multiple variables
separated by commas with a single array.

- Multiple variables are assigned on a one-to-one basis. If the
array has more elements than the variables being assigned, the
remaining elements will not be assigned.

- An asterisk before the final variable name allows the rest of the
array to be assigned to that variable.

- Arrays that are smaller than the number of variables being
assigned will fill the remaining variables with nil.

- Arrays within an array get assigned to a single variable in
multiple assignment.

- Commas without variables after them can be used to do parallel
assignment with differing numbers of variables.

- Easy swaps can be performed without the need for a scratch
variable by using parallel assignment.

[#54146063]