Welcome to the Treehouse Community
Looking to learn something new?
Alphonse Cuccurullo2,513 Points
Can someone help me?
After your .sort! call, add an if statement. If rev is true, call reverse! on arr. Keep your numbers array and the puts statement so that you can see your work in action
def alphabetize(arr, rev=false) arr.sort! if rev == true puts arr.reverse! end end numbers = [1,4,5,6,7,8,55] alphabetize(numbers) puts numbers
Its telling me this " It looks like your method doesn't default to alphabetizing an array when it doesn't receive a second parameter."