For iterator
suggest changeThis iterates from 4 to 13 (inclusive).
for i in 4..13
puts "this is #{i}.th number"
end
We can also iterate over arrays using for
names = ['Siva', 'Charan', 'Naresh', 'Manish']
for name in names
puts name
end
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents