Skip to content

Instantly share code, notes, and snippets.

@carlosrojaso
Created May 14, 2014 21:13
Show Gist options
  • Save carlosrojaso/52a1be98b29f29444942 to your computer and use it in GitHub Desktop.
Save carlosrojaso/52a1be98b29f29444942 to your computer and use it in GitHub Desktop.
JS Flow
// Flow control
var foo = true;
var bar = false;
if ( bar ) {
// This code will never run.
console.log( "hello!" );
}
if ( bar ) {
// This code won't run.
} else {
if ( foo ) {
// This code will run.
} else {
// This code would run if foo and bar were both false.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment