coding for food
[Ruby] break, next
silveryen
2022. 7. 21. 13:50
# break - immediately exist the loop
# next - skips to the next iteration
i = 1
while 1 <= 10
puts i
if i == 5
next
end
puts i
i += 1
end
puts "loop end"