Hello magnificent human beings!!!
If you are here and able to clarify or help me solve this problem you will be the hero of this glorious Wednesday!
As stated in the the title, my code passes the test but does not perform the desired function! I have altered it a few times which still yields a pass but again not the functionality.
def alphabetize(arr, rev=false) arr.sort! puts numbers if rev==true arr.reverse! end end numbers = [ 0, 1, 2, 4, 6,10]
So in the instances where I have altered the code in an attempt to get the functionality I have altered the methods argument to make [rev=true].
My reasoning behind this is that if the method argument states it's true and then I have an [if] statement saying DO THIS IF IT IS TRUE ; it should perform the desired task. Which it of course doesn't. So Lovely.
So I've spent a few moments altering it, as well as putting the fear of god into the syntax by highlighting it and holding my finger centimeters off the delete key for denying me the functionality I'm looking for all the while being reluctant to reverting back to part 1 of the lesson and simply copying the if/else/elsif format there; without luck.
I will be moving on from this task but would love clarification from You about how to fix this functionality error!