Skip to content

Instantly share code, notes, and snippets.

@pvamshi
Created May 3, 2015 17:54
Show Gist options
  • Save pvamshi/6a11af07e1ca0f91fa11 to your computer and use it in GitHub Desktop.
Save pvamshi/6a11af07e1ca0f91fa11 to your computer and use it in GitHub Desktop.
Scope 3
var a = 2;
function abc(b) {
var c = 6;
return function (e) {
var d = 7;
return a + b + c + d + e;
}
}
var f = 3;
var g = 9;
var ex1 = abc(g);
console.log(ex1(f));
a = 4;
console.log(ex1(f));
f = 6;
console.log(ex1(f));
g = 10;
console.log(ex1(f));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment