Does anyone have any improvement suggestions?


#1

The code that I used was as follows, it was accepted but does anyone have any improvement suggestions?

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

numbers = [5, 1, 3, 8]

puts alphabetize(numbers)


5. Sorting with Control flow
#2

@browny2,

puts alphabetize(numbers, rev=false)
puts alphabetize(numbers, rev=true)