Introduction to sorting wth?!?!?!?!


#1

How do I do this stuff?
.sort would sort a copy of my_array, while .sort! sorts my_array in-place (that is, it destroys the original array and replaces it with the sorted version).


#2

@mrc0okiem0nster,

.sort would sort a copy of my_array,

new_array = my_array.sort

while .sort! sorts my_array in-place (that is, it destroys the original array and replaces it with the sorted version).

my_array.sort!