Created
March 28, 2014 16:57
-
-
Save guo-yu/9837575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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