Last active
October 5, 2016 08:52
-
-
Save kodaitakahashi/8bd4099d4b9ac9d63e884277f4131854 to your computer and use it in GitHub Desktop.
複数のbreak文を用いた脱出
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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