10/5= Sorting with control flow.
My code was accepted, though with this error in the editor.
undefined local variable or method `array' for #
this line is confusing me. before, the 'undefined variable or method', was one of the numbers in my array. Help with clearing this up is much appreciated.
def alphabetize(arr, rev = false) array.sort! if rev == true return array.reverse! else return array.sort! end end numbers = [ 6, 5, 8, 11] alphabetize(numbers) puts numbers