I’m new to ruby and I have the following code:
unsorted_array.each do |value|
When it gets to index 1, it crashes and says that smallest is
undefined (on the elsif line). Why is that, when it gets defined in
the first pass (index = 0) ?
Thanks for helping a newbie out.