Skip to content

Commit 791ef2f

Browse files
committed
understanding closures ~ 0.1
1 parent f4992e8 commit 791ef2f

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

closure.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function x(){
2+
var a = 10;
3+
function y(){
4+
console.log(a);
5+
}
6+
y();
7+
}
8+
x();

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<h1>Hello JavaScript</h1>
11-
<script src="index.js"></script>
11+
<script src="closure.js"></script>
1212
</body>
1313
</html>

index.js

Whitespace-only changes.

0 commit comments

Comments
 (0)