def alphabetize(arr, rev=false)
arr.sort!
rev ? arr.reverse! : nil
arr
end
numbers = [3, 9, 3, 2, 1]
alphabetize(numbers)
puts numbers
After looking at other users responses prior to this lesson, I learned to add the variable arr
on line four. My question is, what is the purpose of this? It did not work when I did not add arr
before. Any explanation?