int.times {|i| block } â self
int.times â an_enumerator
int.times â an_enumerator
Instance Public methods
Iterates block int times, passing in values from zero to int - 1.
If no block is given, an enumerator is returned instead.
5.times do |i| print i, " " end
produces:
0 1 2 3 4
Please login to continue.