Created
March 26, 2019 00:34
-
-
Save ksakae1216/fa428d5875ad80df2cc64eaec1a4bb06 to your computer and use it in GitHub Desktop.
This file contains 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
<html> | |
<head> | |
<script> | |
var f = function() { | |
// 'i'にvarを宣言しない | |
for(i=0; i<10; i++) { | |
//'i'を単純にインクリメント | |
} | |
}; | |
f(); | |
</script> | |
<script> | |
alert(i); // 10が表示される | |
</script> | |
</head> | |
<bod> | |
javascript scope test | |
</bod> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment