rubyのfor文にはeach_index的なものはないのでしょうか? ### pythonfor ary = ["taguti","fkoji"] for i in range(len(ary)): print(i) ### rubyeach_index ary = ["taguti","fkoji"] ary.each_index{|i| p i} ### rubyfor for i in ary.length p i# --- NG
Rubyfor
*
* foreach
each_index
ary = %w[taguti fkoji]
ary.each_index{|i| p i}
xcX3v84RxoQ-4GxG32940ukFUIEgYdPy
5464d73a2f33a541b6e73edeaf066d48
Stop