how the loops work ruby code example
Example 1: ruby for loop
for element in array do
element.do_stuff
end
Example 2: rails loop
while $i < $num do
puts("Inside the loop i = #$i" )
$i +=1
end
for element in array do
element.do_stuff
end
while $i < $num do
puts("Inside the loop i = #$i" )
$i +=1
end