固定次数的循环
times
4.times.to_a
#=> [0, 1, 2, 3]
upto
1.upto(4).to_a
#=> [1, 2, 3, 4]
1..4
same to upto
(1..4).to_a
#=> [1, 2, 3, 4]
1…4
(1...4).to_a
#=> [1, 2, 3]
4.times.to_a
#=> [0, 1, 2, 3]
1.upto(4).to_a
#=> [1, 2, 3, 4]
same to upto
(1..4).to_a
#=> [1, 2, 3, 4]
(1...4).to_a
#=> [1, 2, 3]