ITP - methods - mutate

a = [1, 2, 3]

def mutate(array)
  array.pop
end

p "Before mutate method: #{a}"
p mutate(a)
p "After mutate method: #{a}"

We're using the p method to print out the value of whatever the mutate
method returns. Our output looks like this:

"Before mutate method: [1, 2, 3]"
3
"After mutate method: [1, 2]"

Here's what's happening:

    We print out a as we initially defined it.
    We print out the value returned by the mutate method.
    We print out the value of a after the mutate method.

The second line, where it's returning a "3", is probably confusing you a
little bit. What's happening is that method is returning the result of
array.pop back to where it's being called from. pop is a method in the
Array class that removes the last element of an array and returns it.