Ruby Methods (Part 2)

Tutorial Difficulty Level    

Here’s another use of methods. Notice that when we send an array as a parameter, changes in the function do update the value to the caller.

One incidental thing we have not seen before is parallel assignment in the shuffle function which exchanges two values.