Oops, try again. It looks like your syntax isn't quite right. Check the first exercise if you need help!


#1



can you check the code?


def alphabetize (arr, rev=false)
    
    if rev == true
        arr.reverse!
    end
else
    arr.sort!
end
end
numbers = [5,1,3,8]

alphabetize (numbers)
puts numbers

Replace this line with your code.


#2

you need a 'return' see:

def alphabetize(arr,rev=false)
arr.sort!
if rev == true
arr.reverse!
end
return arr
end

numbers = [ 9, 7, 1, 6, 3, ]

result = alphabetize(numbers)

puts result

hope this helps
if this was helpful please solution me!