Last active
August 29, 2015 14:10
-
-
Save PatrickKennedy/52f1c51eec8b716f93e1 to your computer and use it in GitHub Desktop.
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
| 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