Made to Imitate?

for (i = 0; i < numberOfElements; i++) { doSomethingWith(element[i]); } This works, but isn't very elegant. The Ruby way is much more elegant. elements.each do |element| do_something_with(ele