控制流 / 循环
"each"循环
"for-in"循环
"each_with_index"循环
"while"循环
"do-while"循环
"until"循环
"upto"循环
"step"循环
"times"循环
无限循环
nums = [
1
,
2
,
3
,
4
,
5
]
nums.
each_with_index
{|i, v|
puts
"nums[
#{i}
] =
#{v}
"
}