By using next statement, control will go to next iteration of the loop.
Terminates the execution of a block if it will be called in that block.
Example
for i in 0..8
if i < 3 then
next
end
puts "Value of i is #{i}"
end
This will produce the following result:
Value of i is 3
Value of i is 4
Value of i is 5
Value of i is 6
Value of i is 7
Value of i is 8
0 Comment(s)