Created
January 7, 2013 17:31
-
-
Save deniswolf/4476840 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
| function topLevel(){ | |
| var i = 1; | |
| console.log('Top level i: ',i); | |
| function innerLevel(){ | |
| console.log('Inner level i: ',i); | |
| console.log('... because var i was silently declared in the beginning of scope === function'); | |
| var i = 2; | |
| console.log('Inner level i after assigment: ', i); | |
| } | |
| innerLevel() | |
| } | |
| topLevel(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment