Created
August 7, 2013 13:27
-
-
Save blainsmith/6174025 to your computer and use it in GitHub Desktop.
Javascript Stuff
This file contains hidden or 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
// Break a loop | |
var i = 0; | |
theAnswerToTheUniverse: while ( true ) { | |
console.log( ++i ); | |
if ( i === 42 ) break theAnswerToTheUniverse; | |
} | |
// Break an if | |
myTest: if ( condition ) { | |
// some code... | |
if ( anotherCondition ) break myTest; | |
// more code if anotherCondition is falsy... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment