DEV Community

loading...

Discussion on: Labeled Breakout & GOTO

Collapse
wrldwzrd89 profile image
Eric Ahnell

Getting out of a series of nested loops is sometimes necessary - I prefer putting the loop in question into its own function and returning early in the event of an exit before the loop series completes, which avoids the need for labeled breaks and the GOTO statement entirely.