views:

299

answers:

1

I'm iterating through an array in ruby with each. Is there an easy way to get the iteration number or array index without going back to a for loop?

+5  A: 

Ah, got it.

each_with_index

woo!

edit: whoops!

Sam Hoice