If a is the array, I want a.index(a.max), but something more Ruby-like. It should be obvious, but I\'m having trouble finding the answer at so and
a
a.index(a.max)
a = [1, 4 8] a.inject(a[0]) {|max, item| item > max ? item : max }
At least it's Ruby-like :)