Created
July 24, 2014 04:07
-
-
Save masaru-b-cl/fefd22e7c5cc95fee417 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
<script type="text/javascript"> | |
var a = 1; | |
var f = function() { | |
a++; | |
} | |
alert(a); // 1 | |
f(); | |
alert(a); // 2 | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment