Can someone tell me what's wrong with this code


#1

Been trying to get this to the bottom of this for the last hour or so and not getting anywhere.

Can someone tell me what's wrong with this code as I can't see any issues:

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

numbers = [23, 34, 6, 843, 2]
puts alphabetize (numbers, true)`

When run, I get the following error:

(ruby):10: syntax error, unexpected ',', expecting ')'
puts alphabetize (numbers, true)
^


5. Sorting with Control flow
#2

It would appear that Ruby does not expect any white space in the function call.

puts alphabetize(numbers, true)