Skip to content

Instantly share code, notes, and snippets.

@kodaitakahashi kodaitakahashi/break.rb
Last active Oct 5, 2016

Embed
What would you like to do?
複数のbreak文を用いた脱出
# ruby 2.3.0
loop do
puts 'loop1'
loop do
puts 'loop2'
break
end
puts 'escape loop2'
break
end
puts 'escape loop1'
# => loop1
# => lopp2
# => escape loop2
# => escape loop1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.