Skip to content

Instantly share code, notes, and snippets.

@PatrickKennedy
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save PatrickKennedy/52f1c51eec8b716f93e1 to your computer and use it in GitHub Desktop.

Select an option

Save PatrickKennedy/52f1c51eec8b716f93e1 to your computer and use it in GitHub Desktop.
Python:
# both eat() and clean_up() only run if breakfast_food == "bacon"
if breakfast_food == "bacon":
eat()
clean_up()
# clean_up() always runs in this instance
if breakfast_food == "bacon":
eat()
clean_up()
---
Javascript:
if (breakfast_food == "bacon") {
eat();
clean_up();
}
// Same as the above python, clean_up() will always run
if (breakfast_food == "bacon") {
eat();
}
clean_up();
// Javascript can be placed onto a single line, woo!
if (breakfast_food == "bacon") { eat(); clean_up(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment