Question

Is there any way to rewrite this more elegant? I think, that it's a bad piece of code and should be refactored.

>> a = [2, 4, 10, 1, 13]
=> [2, 4, 10, 1, 13]
>> index_of_minimal_value_in_array = a.index(a.min)
=> 3

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top