Skip to content

Instantly share code, notes, and snippets.

@ksakae1216 ksakae1216/sample
Created Mar 26, 2019

Embed
What would you like to do?
<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
You can’t perform that action at this time.