Using a number to iterate that amount of times:
5.times do
puts "Hello!"
end
The times
method can also take a single argument. The times
index starts at 0:
5.times do |item|
puts "Hello! #{item}"
end
Using a number to iterate that amount of times:
5.times do
puts "Hello!"
end
The times
method can also take a single argument. The times
index starts at 0:
5.times do |item|
puts "Hello! #{item}"
end
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)