repo.or.cz
/
tinyjs-rewrite.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
formatting 90% done; encapsulated everything in the TinyJS namespace, and renamed...
[tinyjs-rewrite.git]
/
.svn
/
pristine
/
1b
/
1b7b58a944c557deff51914925de5a9aef130201.svn-base
blob
ad41262eccc3fe33d22ed04b8ada0b5b9f1137b2
1
// function-closure
2
3
var a = 40; // a global var
4
5
function closure() {
6
var a = 39; // a local var;
7
return function() { return a; };
8
}
9
10
var b = closure(); // the local var a is now hidden
11
12
result = b()+3 == 42 && a+2 == 42;