Skip to content

Commit 804323e

Browse files
committed
closuse functions
1 parent 548fdf0 commit 804323e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

closure.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
function f1() {
2+
var a = 100;
3+
/*return function f2(){
4+
console.log(a);
5+
6+
}*/
7+
function f2() {
8+
console.log(a);
9+
}
10+
11+
return f2;
12+
13+
}
14+
var c = f1();
15+
console.log(c);
16+
c();

0 commit comments

Comments
 (0)