Created
December 9, 2011 01:12
-
-
Save jwhitley/1449621 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
// Run me as 'node nested_function.js' | |
var some_text = [ "a", "b", "c"]; | |
var printit = function (text, f) { | |
console.log(text); | |
f(); | |
} | |
var nested = some_text.reduceRight(function(prev, curr) { | |
return function () { | |
printit(curr, prev); | |
}; | |
}, function () { console.log("bootstrap value"); }); | |
nested(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment