Skip to content

Instantly share code, notes, and snippets.

@guo-yu
Created March 28, 2014 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guo-yu/9837575 to your computer and use it in GitHub Desktop.
Save guo-yu/9837575 to your computer and use it in GitHub Desktop.
var a = function(fn1, fn2) {
var value = 123;
return {
fn1: fn1(value),
fn2: fn2(value)
}
};
var b = a(function(value){
return function() {
value = value + 1;
}
}, function(value){
return function() {
return value;
}
});
console.log(b)
b.fn1();
console.log(b.fn2());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment